For those who had the same initial issue, two solutions :
- Override the joint orient offset from the guide
- Mirror the transform from left to right, so controls, guide and joints will all have the same orientation.
I chose the second option using this PRE_ script I wrote :
from mgear.core import string
from mgear.shifter import guide
from mgear import pymaya as pm
from maya import cmds
def get_mirrored_matrix(source_matrix):
mirror_values = [
-1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1]
mirror_mat = pm.datatypes.Matrix(mirror_values)
return mirror_mat * source_matrix * mirror_mat
def mirror_guides():
cmds.select(clear=True)
rig = guide.Rig()
success = rig.setFromSelection()
# This method internally finds the 'guide' node or uses selection
# and populates self.componentsIndex and self.components
if not success:
return
# Iterate over the components
for comp_name in rig.componentsIndex:
comp_obj = rig.components[comp_name]
comp_type = comp_obj.values.get("comp_type")
side_label = comp_obj.values.get("comp_side")
if comp_type in ["EPIC_layered_control_01", "control_01"] and side_label == "L":
# Find right side
r_comp_name = string.convertRLName(comp_name)
r_comp_obj = rig.components.get(r_comp_name)
if not r_comp_obj:
cmds.warning(f"No opposite guide found for {comp_name}")
continue
# Update axis from matrix operations
l_mat = comp_obj.root.getMatrix(worldSpace=True)
new_mat = get_mirrored_matrix(l_mat)
r_comp_obj.root.setMatrix(new_mat, worldSpace=True)
return rig
mirror_guides()
Enjoy !