Vertex Map Tag not in sync error
-
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:
What is causing the tag to not be in sync?
Thank you for your help,
Daniel -
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 -
Hi Ilia,
Thank you very much, I was not aware of that!
Cheers!