Digital Art Zone

 
     
Proper way to remove a series of bones?
Posted: 03 December 2012 08:05 AM   [ Ignore ]
Member
Rank
Total Posts:  54
Joined  2010-09-22

I need to remove a sequence of bones from a figure (and from the scene).  Can I just call dzScene->removeNode() on the root bone, or do I need to follow the entire chain and call removeNode() on each?  If the latter, does the order matter?  E.g. should I start at the end and work my way up to the root?   

I’ve noticed that when you delete a node that has children in the Daz UI it automatically removes any children, but I’m not sure if the behavior is the same using dzScene->removeNode().  I also want to be sure I’m not introducing a memory leak in my code.

Thanks
Ivan

Profile
 
 
Posted: 03 December 2012 01:58 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  14259
Joined  2003-10-09

I would certainly work my way from the tips up the hierarchy, but I don’t know if that is required or if the parenting will adjust when a parent node is removed. If it’s a bone it might be wise to delete its modifiers before the bone, the ERC links before the modifiers.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 03 December 2012 09:11 PM   [ Ignore ]   [ # 2 ]
Member
Rank
Total Posts:  54
Joined  2010-09-22

Looks like you can get away with just removing the root bone.  I tested this by removing the root bone from the figure and then saw the nodeRemoved signal get fired for all its children automatically. 

Profile