thegrid22593
5/9/2018 - 3:25 PM

Clarar.io Helper

list of ways to use the api

Change Visiblity on an Object

// visible
api.scene.setAll({ name: 'object_name', plug: 'Properties', property: 'visible' }, true);
// invisible
api.scene.setAll({ name: 'object_name', plug: 'Properties', property: 'visible' }, false);

Get All Materials

var materials = api.scene.getAll({ type: 'Material', property: 'name' });
for(var id in materials) {
  var button = document.createElement('button');
  button.innerText = materials[id];
  button.onclick = onClick;
  document.getElementById('buttons').appendChild(button);
}