What's the python comand toswitch to a certain item of a switchnode?
e.g. switch to the 3rd item "255_40_9.0x20" of node "***Tire***"
Solved! Go to Solution.
Solved by dlincol1. Go to Solution.
I do not know all the possibilities with the python in vred (I am sure one of the devs can help better) but I know for sure you can just create variantSets for each tire option to be visible then just use selectVariantSet command to select the variantSet that shows the tire you desire.
selectVariantSet(name, excludeViewpoint) Activates a variant set. The variant set will activate all states of its defined node and material variants. Parameters: name - The name of the variant set. (type=string) excludeViewpoint - exclude viewpoint from this variant set. (type=bool)
There is a vrSwitch python node but the example in the python docs doesn't seem to show you can explicitly call a particular option within a switch. Just toggle. Probably doable though but beyond my level now.
Richard
s = findNode('***Tire***')
s.fields().setInt32("choice", 2)
The first child of a switch is 0, so 2 is item 3 from your example.
Open the Node Editor for a Switchnode to see the choice attribute.
Can't find what you're looking for? Ask the community or share your knowledge.