Last active
May 9, 2018 15:26
-
-
Save thegrid22593/ca2eb0c2ffe23f3b5943e4fbfa4273ce to your computer and use it in GitHub Desktop.
list of ways to use the api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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); | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment