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

    Vertex Map Tag not in sync error

    Cinema 4D SDK
    python 2024 windows
    2
    3
    484
    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.
    • D
      danniccs
      last edited by

      Hello,

      I am running the following code to create a vertex map tag on an object (targetObject is a sphere BaseObject every time I call the function):

      # Make object editable
      res = c4d.utils.SendModelingCommand(
      		command = c4d.MCOMMAND_MAKEEDITABLE,
      		list = [targetObject],
      		mode = c4d.MODELINGCOMMANDMODE_ALL,
      		doc = doc )
      
      if res is False or res is True:
      	raise TypeError()
      elif isinstance( res, list ):
      	doc.InsertObject( res[0] )
      
      vertexMapTag = res[0].GetTag( c4d.Tvertexmap )
      if vertexMapTag is None:
      	vertexMapTag = c4d.BaseTag( c4d.Tvertexmap )
      	vertexMapTag[c4d.ID_TAGFIELD_ENABLE] = True
      	vertexMapTag[c4d.ID_TAGFIELD_INVERT] = False
      	vertexMapTag[c4d.ID_TAGFIELD_DEFORMED] = False
      	res[0].InsertTag( vertexMapTag )
      c4d.EventAdd()
      

      After running this I get a sphere with a UVW tag and a vertex map tag, as intended. However, when I select the sphere and select the paint tool, I get the following error:

      77c31dba-62a2-448c-a4d7-e20ae34ed77a-image.png

      What is causing the tag to not be in sync?

      Thank you for your help,
      Daniel

      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @danniccs
        last edited by

        Hi Daniel,

        Please excuse the delayed answer.

        You're not supposed to create tags via constructor. It's expected to be created using MakeVariableTag() function instead. Please have a look at Ferdinand's example here: Negative Vertex Map values

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • D
          danniccs
          last edited by

          Hi Ilia,

          Thank you very much, I was not aware of that!

          Cheers!

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