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

    Python new point indices after points have been deleted

    Cinema 4D SDK
    python
    2
    5
    1.1k
    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.
    • F
      Fabian
      last edited by a_block

      Hello,

      can someone help me to find out how i can get (in Python) the new point index for a PointObject's old point index after some points have been deleted? MSG_POINTS_CHANGED is aid to send a translation map, but apparently this is optional and I had no success in receiving it. There surely is an easier way than to compare each point after the change with each point before the change? Thanks for any hint.

      Fabian

      Edit a_block: Entire post was heading2, fixed

      1 Reply Last reply Reply Quote 0
      • F
        Fabian
        last edited by

        Ok, got it. I was confused by the way Cinema reordered the indices. I was expecting all indices to shift, so when the point with index 10 gets deleted, 11 would become 10, 12 would be 11 and so on. In fact only the point with the highest index jumps down to fill the gap while all others remain the same. Makes sense of course, but it had me confused

        So I can work with that. However, if someone does know how to retrieve the translation map from MSG_POINTS_CHANGED, I'd be very interested. What does it actually mean that the map is optional? Is it that I could include a map if I were to send the message myself?

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

          Hello Fabian,

          I suggest to take a look at the snippets provided in the VariableChanged documentation (the data structure used in conjunction with MSG_POINTS_CHANGED).

          The availability of the translation map depends on the situation. As shown in the docs, there may be no need for it, if the last point gets deleted or a new one is added at the end. But it may also depend on the actual tool sending the message.
          You can not request the map. And you also should not send the message, unless you develop a tool that changes the points array, because for example tags attached to an object would react to the message and interpret it as a new change.

          I turned this thread into a question.

          Cheers,
          Andreas

          1 Reply Last reply Reply Quote 1
          • F
            Fabian
            last edited by

            Hi Andreas,
            thanks for the reply. I wasn't planing to send the message, just trying to understand what's happening. It would make my life sonmewhat easier if there was a way to request the map and having that map sent under all circumstances. But since that's not happening, I'll have to work around that.

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

              I forgot to turn this thread into a question. Done now, and as I regard the last post as a "solved" message, I also marked it as solved. Please, don't hesitate to turn back to unresolved, if I was wrong.

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