Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Removing objects from InExclude List and GUI (CommandData Plugin)

    Cinema 4D SDK
    python windows r19
    2
    3
    803
    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.
    • A
      AndreAnjos
      last edited by

      Hi everyone,

      Trying to find a solution to remove objects from a InExclude List from a CommandData plugin.

      inExcludeData = self.linkObjs.GetData()
      objCount = inExcludeData.GetObjectCount()
      
      for i in range(objCount):
          print inExcludeData.ObjectFromIndex(activeDocument, i)
          print objCount
          inExcludeData.DeleteObject(i)
      

      I can see that that the count goes down and assume the list is being cleared, but the GUI still shows the objects. How can I update it please?
      Apologies if this has been solved before, as I couldn't find the thread or answer.

      Thank you in advance! ☺

      Andre

      1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hi Andre,

        by calling GetData() you receive a copy of the InExcludeData. By writing the changed data back via SetData() it should work as expected.

        I turned this thread into a question.

        Cheers,
        Andreas

        1 Reply Last reply Reply Quote 1
        • A
          AndreAnjos
          last edited by

          Amazing! Thank you again Andreas!

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