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
    • Recent
    • Tags
    • Users
    • Login

    Undo for Variables

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 303 Views
    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.
    • H Offline
      Helper
      last edited by

      On 30/04/2014 at 07:03, xxxxxxxx wrote:

      Hey,

      i know how the Undo function in the SDK works, but i have a problem with it 😄

      How can i undo a variable?

      As a example i have a counter and every time i click the counter get + 1.
      How can i redo the counter?

      The problem with pseudo code:

      counter = 0
      onClick(){
      c4d.StartUndo()
      counter = counter + 1
      c4d.AddUndo(counter) # how i want it 😉
      c4d.EndUndo()
      }

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 30/04/2014 at 07:17, xxxxxxxx wrote:

        That's not possible. You have to save the state in an object or the document or know how you
        can re-calculate the state based on other data.

        -Niklas

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 30/04/2014 at 07:20, xxxxxxxx wrote:

          Re-calculate is not possible, thats needs to much cpu power 😕

          How i can save the data in the object / document?
          It is possible to save a list?

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