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
    • Register
    • Login

    How to read Field driven VertexMapTag's

    Cinema 4D SDK
    2023 c++
    3
    4
    691
    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.
    • K
      khor
      last edited by

      I'm always getting NULL with GetDataAddressR() on a VertexMapTag when it's used on primitives with Field driven. I'm assuming the data is on the VertexMapTag over Cache object under the primitive. But I cannot think a safe way to reach to the tag else of iterating the tags on Cache. But it doesn't looks to me safe enough. We may have a few VertexMapTags and may not provide matching one. Is there a better way to read values?

      bacaB 1 Reply Last reply Reply Quote 0
      • bacaB
        baca @khor
        last edited by

        @khor Hi,

        From my python experience Primitives has no points/polys so vertex tags has no data count, so and GetDataAddressR() is None

        The bad thing is that vertex tag is not evaluating but just cloned onto it's cache (with the Fields property!).
        So if Vertex Tag has Use Deformed Points is on, then all values would be zero at the time of execution Deformers for ex.

        Considering that you need to retrieve tag of same type + same name from the cached object (in wide mean, so prefer to retrieve deform cache over just cache), and crossfinger everyone use unique tag names per object.

        I believe that's why all new features uses string input fields rather than link field.
        But that's actually great.

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          hi,

          there is no better or safer way than checking the value on the tag that is on the cache of the object. If you have mutiple VertextMapTags on your object, you can use GetOrigin to check if the tag on the cache have been cloned from the tag you are trying to retrieve the values.

          Another way is to evaluate values from the field inputs, you can find an example in our GitHub repository in python to do so. You must create a polygon object of the primitive and retrieve the points coordinates to know which point to sample. This will allow you to create the fieldInput.

          Cheers,
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • K
            khor
            last edited by

            Yes that's what afraid to hear:)
            I did iteration over tags of Cache/Deform Cache and compare with GetOrigin() thingy to find related tag. I believe there should be some functionality in the SDK. Thanks for answers!

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