Hello there!
I'm starting a new TAG plugin development and I would like to affect OLight
parameter, i.e. c4d.LIGHT_COLOR
, but my DescId
does not reach its target.
All this is happening in dataTag.Execute
.
Here the code, and the GetParameter
returns only None
, which means there is something wrong...
# TAG Execute() method
def Execute(self, tag, doc, op, bt, priority, flags):
self.tagData = tag.GetDataInstance()
sim_color = c4d.Vector(0) # For debug purpose, set a black color value
if op.GetType() == c4d.Olight:
# For debug purpose
print( op.GetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_COLOR, 0)), c4d.DESCFLAGS_GET_PARAM_GET ) )
op.SetParameter( c4d.DescID(c4d.DescLevel(c4d.LIGHT_COLOR, c4d.DTYPE_COLOR, 0)), sim_color, c4d.DESCFLAGS_SET_USERINTERACTION )
return c4d.EXECUTIONRESULT_OK
I tried different flags for SetParameter
, but based on @ferdinand explanation on CTrack, it seems that c4d.DESCFLAGS_SET_USERINTERACTION
is the good one.
If someone can light me up on this, that would be awesome.
Cheers,
Christophe