Hi,
I am having another question related to scripting:
I would like to turn on/off any listed model sets. The problem is I could not find any command doing that.
The function lux.getModelSets() gets the active Model Sets in the scene. When only a single Model Set (or a few) is active at a time, it won’t be able to get the inactive ones.
For manipulating Model Sets, you can get them as SceneNodes instead. This will allow you to get all Model Sets (including inactive ones), rename them, activate a selection etc.
Here is a simple example to get you started:
#get the contents of the scene as a SceneNode
root = lux.getSceneTree()
#find the Model Set nodes by filtering on the Model Set node type
msets = root.find(types = lux.NODE_TYPE_MODEL_SET)
#to activate Model Sets, a list needs to be passed to lux.setModelSets()
#create a new empty list
msetlist = []
#get the names of all Model Sets and append them to ‘msetlist’
for node in msets:
msetname = node.getName()
msetlist.append(msetname)
#use the list to activate a selection of Model Sets
#example 1: activate all Model Sets
lux.setModelSets(msetlist)
#example 2: simultaneously activate the 1st and 3rd Model Set
lux.setModelSets([msetlist[0], msetlist[2]])