Load a poser preset by script
Bubbsi
Posts: 6
Hello Guys,
I´ve once more a question =).
So I want to load a poser preset for a genesis2 model. My Problem is if the correct node isn´t selected in the scene I can´t load the poser, so the preset will only load for an other object :/.
I researched the Scene class documentation but I can´t find the right function to select an individual node.
Can anyone help me, plz?
David.
Post edited by Bubbsi on
Comments
Remember that some Poser files at least will not work on Genesis 2 - they require conversion to .duf files first. Or do you mean a native pose preset, not a Poser file?
If you know the label of your target item you can use Scene.findNodeByLabel( label ) and then node.select( true ) to make it selected (you may also want to make sure nothing else is selected)
you can also use Scene.findNode( name ) to search by name.
It´s my own poser preset so it works =).
This was what I searched for, thank you!
But now there are two Items selected. I tried to Clear my selection with action = getAction(166) (166 number for "Clear Selection") and action.trigger(). the script works, but nothing happens :P.
The index of an action can/will change as new functionality is added, be it in the core or through a plugin, so you don't want to use an index to find an action. The recommended approach is to use the classname of the action like I do in this sample.
You can find the classname of an action using this sample.
You can also directly deselect all nodes, and then select the desired node, like so...
-Rob