[Solved] Deleting a follower by script
meipe
Posts: 101
I'm writing a script to quickly remove some followers from a figure.
So I iterate all nodes from the root, and check their label to find the one to delete.
I was wondering what's the best way to delete the node... do I have to use removeNodeChild (DzNode child, Boolean inPlace=false) /removeAllNodeChildren () or is there another way? I believe removeNodeChild only unparents the node?
Post edited by meipe on
Comments
You don't even have to unparent the node if you wanna delete it.
Use the Scene.removeNode(DzNode) method,
in your case Scene.removeNode(oNodeToBeDeleted)
I have writen the next script to delete many copies of an item, attached to a figure. Use it as you want. It is well commented.
I used it when I made my Rock Jewelry products. When I tried the rings on the figure (1 to each finger), I ended up with a Genesis with 10 copies of the same ring, so I wrote the next script to easily remove them.
Works great, superthanks! :) :) :)