Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Undo SetSceneCamera

    Cinema 4D SDK
    3
    5
    653
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kbarK
      kbar
      last edited by kbar

      Is it possible to add an undo event that will take care of changes made when calling BaseDraw::SetSceneCamera?

      https://www.gamelogicdesign.com
      https://www.plugins4d.com

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        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

        MAXON SDK Specialist

        MAXON Registered Developer

        kbarK 1 Reply Last reply Reply Quote 0
        • kbarK
          kbar @Manuel
          last edited by kbar

          @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.

          https://www.gamelogicdesign.com
          https://www.plugins4d.com

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            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

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • ferdinandF
              ferdinand
              last edited by

              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

              MAXON SDK Specialist
              developers.maxon.net

              1 Reply Last reply Reply Quote 0
              • First post
                Last post