Hi,
I want to get the same results mirroring two objects with either matching or different axes. For my examples, I have two objects, L_Cone & R_Cone, on opposite sizes of the ZY plane. Both of their local transformations are being reset by a parent Null (positions & rotations are 0, scale is 1)
In the first example, I have two objects whose axes are oriented differently (e.g. +X & -X on Z). I'm going to manipulate the transformations of R_Cone. I want to transfer this rotation to L_Cone so that it's mirrored on the ZY plane.
How can I code this transfer so that it gets the same result, regardless of the axis offset? In the first example with the different orientations, the position values are negated and the scale/rotation values are the same so it'd be as simple as:
lCone[c4d.ID_BASEOBJECT_ABS_POSITION] = -rCone[c4d.ID_BASEOBJECT_ABS_POSITION]
lCone[c4d.ID_BASEOBJECT_ABS_SCALE] = rCone[c4d.ID_BASEOBJECT_ABS_SCALE]
lcone[c4d.ID_BASEOBJECT_ABS_ROTATION] = rCone[c4d.ID_BASEOBJECT_ABS_ROTATION]
In the second example, however, that code wouldn't work because pos.X, rot.H, & rot.B are negated.
I thought I could get the difference between the Cones' Parents' Matrices and add that to the new values but it didn't work.
lMat = coneL.GetUpMg() # L_Cone's Parent Matrix
rMat = coneR.GetUpMg() # R_Cone's Parent Matrix
offsetMat = lMat-rMat # the offset between the two parents
coneL.SetMg(coneR.GetMg()+offsetMat) # the offset Matrix added to the R_Cone's Matrix
Could anyone please shed light on why this isn't working or how to do this another way?
Thank you!