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

    Set Selection to nothing

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 514 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 24/05/2013 at 06:11, xxxxxxxx wrote:

      How can you set the selection to nothing?

      I know there is nothing selected by default, but in my plugin I used BaseDocument.SetSelection( bl [, mode=SELECTION_NEW ]). At a later point I want nothing to be selected, how should I arrange that, because you need a baseobject for bl?

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

        On 24/05/2013 at 06:46, xxxxxxxx wrote:

        Allready found it.

        c4d.CallCommand(12113) # Deselect All

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

          On 24/05/2013 at 07:13, xxxxxxxx wrote:

          this is how you would do it yourself.

          for obj in doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN) : obj.ToggleBit(c4d.BIT_ACTIVE)
          c4d.EventAdd()
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 24/05/2013 at 08:41, xxxxxxxx wrote:

            Try to avoid CallCommand() calls. They will break your undo step apart. As littledevil
            already showed, you can change the selection-state manually. Rather use DelBit() though,
            since ToggleBit() does invert the state, rather then setting it to off/false.

            Best,
            -Nik

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

              On 24/05/2013 at 08:59, xxxxxxxx wrote:

              Thanks guys!

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