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

    Updating Polygon Selection Tag

    Cinema 4D SDK
    python
    3
    4
    1.3k
    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.
    • G
      Graeme
      last edited by

      Hi there, I'm writing a script in python & I wanted to ask how I can update a polygon selection tag (Exactly as if you call the 'Select' -> 'Set Selection' command with the polygon selection tag selected).

      Basically, I am Getting the C4d.BaseSelect from the c4d.SelectionTag & altering the C4d.BaseSelect - afterwards, I want to update the c4d.SelectionTag with the changes.

      Here is a very simplified sample code:

      curr_sel = sel_tag.GetBaseSelect()
      comp_sel = comp_tag.GetBaseSelect()
      curr_sel.DeselectFrom(comp_sel)

      Now I would like to write my modified curr_sel back to the sel_tag Polygon Selection Tag, but I don't know how.

      I am prepared to select it in the interface & use CallCommand as a last resort, but it's not very elegant & I won't be able to add undos.

      Thanks in advance for your help.

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by mp5gosu

        Hi there,

        since the docs say you get the selection instance by calling GetBaseSelect(), you simply can modify the BaseSelect and update the object accordingly.
        The BaseSelect itself comes with some useful functions, like CopyTo() that may do what you want.

        And may I to point you to: Q/A functionality and How to post questions. It makes life easier for all, if new threads and questions are tagged and organized in a nice way. 🙂

        1 Reply Last reply Reply Quote 0
        • G
          Graeme
          last edited by Graeme

          Firstly, thanks for your reply.
          Secondly, for the Q&A, it seems like the way the forum works has updated since I last used it. I will be sure to follow the correct protocol in future.

          Well, I just typed out a big answer & then I saw that you're right - the Polygon Selection Tags are already updated, without me having to do anything more !

          Is there some message I should send to the tags for safety, like a MSG_CHANGE from the c4dAtom ?

          1 Reply Last reply Reply Quote 0
          • r_giganteR
            r_gigante
            last edited by

            Hi @Graeme, thanks for reaching out us.

            With regard to your request, aside from the @mp5gosu notes I'd like to point you to this discussion where SelectionTag creation is presented.

            Feel free to come with any further consideration.

            Best, Riccardo

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