to select node with childrens in specific figure in scene
YudinEd
Posts: 90
I have some Genesis figures in the scene. I have select node with children in specific figure. I found the scripts here, similar to the solution of this problem. But I select only the first figure in the list. But I have to work with the second, third and so on. What I can do?
I tried to do so.
var Fig = Scene.findNodeByLabel( "Genesis (2)" ); // I try to work with 2th item in list Fig.select( true );if (Fig) {var item = Scene.findNodeByLabel( "Left Hand" );// "Left Hand" in Genesis(2)item.select( true );// Selected childrenvar roots = Scene.getSelectedNodeList();var n = roots.length;for( var i = 0; i < n; i++ ){selectChildren( roots[ i ] )}function selectChildren( root ){var children = root.getNodeChildren( true ); //recursevar n = children.length;for( var i = 0; i < n; i++ ){var node = children[ i ];node.select( true );}}}
Post edited by YudinEd on
Comments
Use Scene.getSelectedSkeletonList() (if you want to deal with only selected items) or Scene.getSkeletonList() (if you don't care about selection state) then use skelList[ n ].getLabel().startsWith( "Genesis" ) to identify the Genesis figures (or whatever you want to look for).
I'll think ....
I understand Scene.getSkeletonList() and Scene.getSelectedSkeletonList() , but I see for the first time this function skelList[ n ].getLabel().startsWith( "Genesis" ) . I imagine badly, where it is inserted and how to arrange it in the script
I tried now so. I haven't errors, but haven't results too. :) - no selected node with children (in my case "Left Hand" in Genesis(2)
I was suggesting getting the list of skeletons, finding the oens that have a label starting with Genesis and then checking those for the second one, then using the findNodeChild on that to get and select the bones.
OK, now I select needed figure (Genesis 2) in scene with some chatacters and choose the bone (lHand) in this figure.
I'll write later with children ( perhaps if I give birth)
Next was easy :)