Denis, thanks to you the problem has been solved. Thank you! And here is the solution itself with my objects in the scene:
-- Mirror image of left to right rotation:
leftController = $CClavicle_Controller_L
rightController = $CClavicle_Controller_R
-- Function to get mirror matrix
fn getMirrorTM axis =
(
MIRROR_TM_X = matrix3 [-1,0,0] [0, 1,0] [0,0, 1] [0,0,0]
MIRROR_TM_Y = matrix3 [ 1,0,0] [0,-1,0] [0,0, 1] [0,0,0]
MIRROR_TM_Z = matrix3 [ 1,0,0] [0, 1,0] [0,0,-1] [0,0,0]
case axis of
(
#x: MIRROR_TM_X
#y: MIRROR_TM_Y
#z: MIRROR_TM_Z
default: matrix3 1
)
)
-- Function to mirror the transform
fn mirrorTransform mat axis:#x =
(
return mat * getMirrorTM axis
)
-- Get the current transform of the left controller
leftTM = leftController.transform
-- Mirror it along the X axis
mirroredTM = mirrorTransform leftTM axis:#x
-- Apply the mirrored transform to the right controller
rightController.transform = mirroredTM
--------------------------------------------
-- Mirror image of right to left rotation:
rightController = $CClavicle_Controller_R
leftController = $CClavicle_Controller_L
-- Function to get mirror matrix
fn getMirrorTM axis =
(
MIRROR_TM_X = matrix3 [-1,0,0] [0, 1,0] [0,0, 1] [0,0,0]
MIRROR_TM_Y = matrix3 [ 1,0,0] [0,-1,0] [0,0, 1] [0,0,0]
MIRROR_TM_Z = matrix3 [ 1,0,0] [0, 1,0] [0,0,-1] [0,0,0]
case axis of
(
#x: MIRROR_TM_X
#y: MIRROR_TM_Y
#z: MIRROR_TM_Z
default: matrix3 1
)
)
-- Function to mirror the transform
fn mirrorTransform mat axis:#x =
(
return mat * getMirrorTM axis
)
-- Get the current transform of the right controller
rightTM = rightController.transform
-- Mirror it along the X axis
mirroredTM = mirrorTransform rightTM axis:#x
-- Apply the mirrored transform to the left controller
leftController.transform = mirroredTM
This works in the global coordinate system. Unfortunately, I did not understand the local system, but it is not a big deal since my rig is attached to Biped, I get local coordinates by activating the Biped editing mode:
-- Figure Mode
$Bip001.controller.figureMode = true
-- Deactivate Figure Mode for Biped
$Bip001.controller.figureMode = false
Again, a huge THANK YOU!!!