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

    How to get weights from a Vertex Map tag on an uneditable object

    Cinema 4D SDK
    2023 python
    3
    5
    828
    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
      kng_ito
      last edited by

      Hi,

      I tried to get the weight values from a Vertex Map tag in the documented way.
      It workd for editable polygon objects, but not for uneditable obejcts.

      The .c4d file:
      VertexMapWeightsFromUneditableObjects.c4d

      The code:

      import c4d
      
      def main():
          tag = op.GetFirstTag()
          weight = tag.GetAllHighlevelData()
          print(weight)
      
      if __name__ == '__main__':
          main()
      

      The result for uneditalble cube:

      Traceback (most recent call last):
        File "scriptmanager", line 9, in <module>
        File "scriptmanager", line 5, in main
      SystemError: <method 'GetAllHighlevelData' of 'c4d.VariableTag' objects> returned NULL without setting an error
      

      The result for editalble cube:

      [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0]
      

      Is there any way to get the weight values for uneditable objects? Thank you.

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

        @kng_ito said in How to get weights from a Vertex Map tag on an uneditable object:

        First tag might be invisible tag.
        So you need to specify tag, and check if it's exist, like so:

        def main():
            tag = op.GetTag(c4d.Tvertexmap)
            if tag:
                weight = tag.GetAllHighlevelData()
                print(weight)
        

        But most probably generator's weight tag contents would be irrelevant to what you expect to see.

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

          hi,

          this topic was discussed in this thread. The answer is the same, you need to retrieve the cache of your generator and search for the vertex tag. With GetOrigin you can compare from witch tag it have been cloned and be sure you are targeting the right one.

          This cloned tag contains the data you are looking for.

          MAXON SDK Specialist

          MAXON Registered Developer

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

            Hi @Manuel ,
            Sorry for asking a question that has already been resolved in another thread.
            That thread solved my question. Thank you.

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

              @kng_ito said in How to get weights from a Vertex Map tag on an uneditable object:

              Sorry for asking a question that has already been resolved in another thread.

              Don't worry, we are glad to help.

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

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