Undo SetSceneCamera
-
Is it possible to add an undo event that will take care of changes made when calling BaseDraw::SetSceneCamera?
-
hi,
there are two buffers for the undo, you can add an undo in the viewport stack using InitUndo but i guess you are talking about adding an undo step in the "regular" stack?
Cheers,
Manuel -
@m_magalhaes said in Undo SetSceneCamera:
there are two buffers for the undo, you can add an undo in the viewport stack using InitUndo but i guess you are talking about adding an undo step in the "regular" stack?
I have been working with C4D for 12 years and I only just learned that "Undo View" actually existed.
But sadly the bd->InitUndo is not what I am after. Since I am wanting to call SetSceneCamera as part of a command operation. So I would like it if the user pressed the regular Ctrl-Z and it undid the changes to the view as well as undoing the SetSceneCamera call.
It doesn't seem like this is possible.
-
Hi,
You can press ctrl+shift+Z to undo the viewport modification.
I don't think it's possible. The active camera link is stored inside the BaseDraw and you can't add the BaseDraw in the regular undo stack. (i did try, c4d isn't happy)
The only workaround i see would be:
- add a null object as the first object with a certain value on its basecontainer. (maybe a link to the "old" camera)
- set the camera
- remove the null object
- tell a scenehook it must check if the first object is your null object.
If the scenehook found your null object:
- make the linked camera the active one
- remove the null object
- tell itself it must stop looking for the null object.
Something that could tell you that the undo step is the step where you defined the camera.
Cheers,
Manuel -
Hello @kbar,
without any further questions, we will consider this topic as solved by Tuesday, November the 2nd and flag it accordingly.
Thank you for your understanding,
Ferdinand