Hi,
the tag can not directly react to parameter changes of the host object. But instead you could store the parameter values somewhere, in my example I'll use user data on the tag, and then act upon value changes in the tags Execute()
function.
Here's a small example, what I mean:
def main():
# Example: Linking the x and y size of a cube.
# In this example using [c4d.ID_USERDATA,1] and
# [c4d.ID_USERDATA,2] to remember last parameter values
hostObj = op.GetObject()
# awkward initialization, do something better...
if op[c4d.ID_USERDATA,1] < -100000:
op[c4d.ID_USERDATA,1] = hostObj[c4d.PRIM_CUBE_LEN].x
op[c4d.ID_USERDATA,2] = hostObj[c4d.PRIM_CUBE_LEN].y
return
# actual parameter linking
if op[c4d.ID_USERDATA,1] != hostObj[c4d.PRIM_CUBE_LEN].x:
hostObj[c4d.PRIM_CUBE_LEN] = c4d.Vector(hostObj[c4d.PRIM_CUBE_LEN].x,
hostObj[c4d.PRIM_CUBE_LEN].x * 2.0,
hostObj[c4d.PRIM_CUBE_LEN].z)
elif op[c4d.ID_USERDATA,2] != hostObj[c4d.PRIM_CUBE_LEN].y:
hostObj[c4d.PRIM_CUBE_LEN] = c4d.Vector(hostObj[c4d.PRIM_CUBE_LEN].y / 2.0,
hostObj[c4d.PRIM_CUBE_LEN].y,
hostObj[c4d.PRIM_CUBE_LEN].z)
# store new values for next run
op[c4d.ID_USERDATA,1] = hostObj[c4d.PRIM_CUBE_LEN].x
op[c4d.ID_USERDATA,2] = hostObj[c4d.PRIM_CUBE_LEN].y
And here's the scene: synced_params.c4d
Cheers,
Andreas