Being notified when an object returns to the scene via undo

pcicconepciccone Posts: 661
edited December 1969 in Daz SDK Developer Discussion

Hi.
In developing the next version of Reality I monitor object addition to the scene and that works fine.
When the user deletes an object and then selects Undo Studio, does not notify my plugin of that addition. Is there a way of receiving notification of that event?

Thank you.

Comments

  • dtammdtamm Posts: 126
    edited December 1969

    What signal are you looking for?
    - DzScene::nodeAdded does fire when undoing a delete.

  • pcicconepciccone Posts: 661
    edited December 1969

    I'm looking for directions on how should I handle this. If an object is added back to a scene because the user presses Undo Reality needs to be notified so that it can re-add the object to its database.

    Thanks in advance.

  • dtammdtamm Posts: 126
    edited December 1969

    Best to confirm,
    1) The DzScene:nodeAdded signal is not happening
    2) OR you need to know more information when DzScene:nodeAdded happens, (that is was caused by an undo)?

  • pcicconepciccone Posts: 661
    edited December 1969

    dtamm said:
    Best to confirm,
    1) The DzScene:nodeAdded signal is not happening
    Not with the Undo. When an object is added to the scene via the Content Manager then the signal is sent and Reality reacts to it.

    2) OR you need to know more information when DzScene:nodeAdded happens, (that is was caused by an undo)?

    I'm not sure how to interpret this.
    When an object is deleted from the scene Reality gets the notification and removes the object from its database. If the user presses Cmd/Ctrl-Z immediately after then Studio adds the object to the scene but does not signal Reality.

    Hope this helps.

  • dtammdtamm Posts: 126
    edited December 1969

    Yes it does help. Under all circumstances I have tested, DzScene::nodeAdded is happening when caused by an Undo of delete.

    Maybe to help track it down, connect to nodeListChanged() and see if you are getting that on undo.

  • pcicconepciccone Posts: 661
    edited December 1969

    dtamm said:
    Yes it does help. Under all circumstances I have tested, DzScene::nodeAdded is happening when caused by an Undo of delete.

    Maybe to help track it down, connect to nodeListChanged() and see if you are getting that on undo.


    I will, thanks
Sign In or Register to comment.