Congratulations! You are a March Madness BONUS BUYER!

Enjoy 10% OFF* ALL PURCHASES STOREWIDE or enjoy 30% OFF items with a SKU number lower than 16000 & 30% OFF items from Runtime DNA.

Offer valid for intended recipient only
* 10% discount DOES apply to Gift Cards and Memberships. **Items must be in cart simultaneously for discount to apply.
[ collapse ]

Proper way to remove a series of bones?

shoei321shoei321 Posts: 88

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

Comments

  • Richard HaseltineRichard Haseltine Posts: 32,639
    edited December 2012

    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.

    Post edited by Richard Haseltine on
  • shoei321shoei321 Posts: 88
    edited December 1969

    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.

Sign In or Register to comment.