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

    BaseDraw Undos

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 412 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 20/09/2017 at 14:47, xxxxxxxx wrote:

      Hi, I'm was making a pretty simple script dealing with the BaseDraws of a document.

      import c4d
      from c4d import gui
        
      def main() :
          
          doc.StartUndo()
          checkspot =0
          while doc.GetBaseDraw(checkspot) != None:
              bd = doc.GetBaseDraw(checkspot)
              doc.AddUndo(c4d.UNDOTYPE_CHANGE,bd)
              bd.SetName("Viewport " + str(checkspot))
              checkspot = checkspot+1
          doc.EndUndo()
          c4d.EventAdd()
      if __name__=='__main__':
          main()
        
      
      

      So I'm just renaming each of the BaseDraws, which works fine.  But when I use the Undo that I implemented the current BaseDraw that I'm viewing changes as well as the names of the BaseDraws reverting and I'm not sure why that would swap my view.

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

        On 21/09/2017 at 04:00, xxxxxxxx wrote:

        Hi,

        I'm afraid changing the name of a BaseDraw/viewport is not an undoable change.

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

          On 22/09/2017 at 10:41, xxxxxxxx wrote:

          Thanks!

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