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's and SendModelingCommand

    Cinema 4D SDK
    r20 python
    2
    2
    387
    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.
    • P
      pim
      last edited by

      I am not sure how to / where to place Undo's when using a CSTO.
      Should it be before (with an UNDOTYPE_CHANGE) or after (with an UNDOTYPE_NEW)?

              #doc.AddUndo(c4d.UNDOTYPE_CHANGE, poly)        
              objList = c4d.utils.SendModelingCommand(
                  command = c4d.MCOMMAND_CURRENTSTATETOOBJECT,
                  list = [poly],
                  mode = c4d.MODELINGCOMMANDMODE_ALL,
                  doc = doc,
                  )       
              doc.AddUndo(c4d.UNDOTYPE_NEW, objList[0])
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @pim only UNDOTYPE_NEW is needed.

        Moreover, I would like to mention that SendModelingCommand offers the MODELINGCOMMANDFLAGS_CREATEUNDO flags in order to automatically creates undo.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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