PDA

View Full Version : Controller's mirror problem.


MoutMout
12-08-2008, 10:02 AM
Hello everyone !

I have a problem and I don't know how to solve it.

I work in maya and I want to duplicate my contoller of the left arm to the right arm. So i do an empty group and place my controller in it which it has is origin axis at the center of my viewport. Next I duplicate this new group and put the scale X on -1 and next ungroup my controller and ...now I have my controller "right_arm_ctrl" ( I hope it's clear :S ).

My problem is, when i do that, my axis on the new controller ( here "right_arm_ctrl" ) is'nt good and I don't find how to do a another method to mirror my controller and have the same my axis of my left and right controllers at the axis of my left and right bones.

Hope it's clear and sorry for my english.

Cheers,
Moutmout.

MoutMout
12-08-2008, 11:22 AM
Does anyone have a solution please, because it's for my work.

Thank you in advance !

mlefevre
12-08-2008, 12:55 PM
If you've set it up so that the wrist controllers have the same rotation axis as your wrist joints, duplicate your left controller along with it's group.

snap the group over to your right side (along with it's child, the controller), parent it under the wrist joint, freeze the transforms on the group, then unparent it.

Hope that helps :/

MoutMout
12-10-2008, 10:57 AM
The problem it's if I freeze tranform my group the axis rotation of my controller return to it default position ( I mean the same as the viewport ).

But thanks for your advices mlefevre.

mlefevre
12-10-2008, 12:18 PM
Take a look at this, not sure if it's what your after.

Hope that helps. :)

tonytouch
12-10-2008, 02:58 PM
hi moutMout,

i am not sure , what 's your problem ... but here is how , i mirror my shapes

1. when i create my controls - i use following method to bring the Left and Right "*_NUL" - groups into the right position .

delete `parentConstraint L_wrist_jnt L_wrist_NUL`;
delete `parentConstraint R_wrist_jnt R_wrist_NUL`;

( inside the *_NUL-grop , there is my L_wrist_CON - the controlcurve )

2. then i go into component mode of my L_wrist_CON_shape and move around the CVs , to fit them to be , where the shall be ( e.g. rotate them around 90 degree and move and scale them )

3. next mirror the shape from the L_side to the R_side - with this tiny script ( which goes through all the CVs of the shape-nodes and just copies the CV_positions , to be X=-X , Y=Y ,Z=Z .


global proc sl_shapeMirror(string $sl_shape,string $sl_shapeMirror)
{

int $sl_nSpans = `getAttr ( $sl_shape + ".spans" )`;
int $sl_degree = `getAttr ( $sl_shape + ".degree" )`;
int $sl_form = `getAttr ($sl_shape + ".form" )`;

int $sl_nVerts= $sl_nSpans + $sl_degree;
if ( $sl_form == 2 ) $sl_nVerts-= $sl_degree;

float $p[];

for ($i=0;$i<$sl_nVerts;$i++)
{
$p = `xform -q -ws -a -translation ($sl_shape + ".cv[" + $i + "]") `;
xform -ws -a -translation (0-$p[0]) $p[1] $p[2] ($sl_shapeMirror + ".cv[" + $i + "]");
}

}

sl_shapeMirror("L_wrist_CON_Shape","R_wrist_CON_Shape");


( be sure , to check out in the OUTLINER , that DISPLAY SHAPES is turned on - it is just simpler that way )

Brighton
12-12-2008, 09:17 PM
The problem it's if I freeze tranform my group the axis rotation of my controller return to it default position ( I mean the same as the viewport ).

But thanks for your advices mlefevre.
Are you using Nurbs Objects as your controllers?
If you freeze transforms on a circle, it stays in place, if you freeze transforms on a Locator it moves to 0,0,0.

The Process of Duplicate, Scale -1 = x (or whatever plan of symmetry) will reverse the local rotation when you rotate the controller.
Ie: rotating the elbow up will be a positive value on 1 arm, and negative on the other arm.

Snapping the placement instead of Mirror + Freeze is a safer bet.

tonytouch
12-13-2008, 10:17 AM
Snapping the placement instead of Mirror + Freeze is a safer bet.

yeah , that is true .

i was once taught , that you should not even freezeTransforms on "any" of the controls , since then i always createCurve , put them into a *_NUL-group , move the *_NUL group , to its target ( e.g. by parentConstrainting it to the wrist_jnt ) , then i go into component-mode and scale all the CVs ( not the entire transform-node ) , rotate and move the CVs - finally just mirror the shapes , to the other side.

Ie: rotating the elbow up will be a positive value on 1 arm, and negative on the other arm.

if you are planing on "mirroring-the-behaviour" of your controls - i personally would suggest you , NOT TO do so - else it might end up in confusions - as one of your controls will always react in the opposite direction , if you move it in object space - but you might need to find that out on your own .

----------------

if you want to mirror the control from one side to the other ( after rigging , for animation ) - you can simply use 4 MEL-lines like this

float $translation[] = `xform -q -ws -translation R_hand_IK_CON`;
float $rotation[] = `xform -q -ws -rotation R_hand_IK_CON`;

xform -q -ws -translation (0- $translation[0]) $translation[1] $translation[2] R_hand_IK_CON;
xform -q -ws -rotation $rotation[0] (0 - $rotation[1]) (0 - $rotation[2]) R_hand_IK_CON;

you can then call a simple script , each time you want to mirror a pose

CGTalk Moderation
12-13-2008, 10:17 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.