PDA

View Full Version : How to mirror Skeleton poses?


Asphalt
01-01-2009, 01:02 AM
Is there a way to mirror skeleton poses?
I have several complex left-hand poses that I would like to apply to the right-hand.
I'm using XSI's Character Development Kit biped rig, but can't find any tool for mirroring poses. Does it exist or is there some other way to achieve this?

Asphalt
01-03-2009, 05:23 AM
It took a bit of hunting around to figure out how to mirror poses with the CDK Biped Rig - I ended up writing a script to do it.

It seems like this is a feature that quite a few people are looking to be added into the next version of XSI...hint, hint Autodesk...

Please note that this is my first ever script written in XSI, so it will probably require some tweaking to work for anyone else who tries to use it...things like object names ("Biped") I hard-coded, so you may have to change that to fit your hierarchy naming scheme.

This JScript just takes the rotations from the Left hand elements and applies them to the Right hand.


// Thumb
var rx = GetValue("Biped.LThumb1.kine.local.rotx");
var ry = GetValue("Biped.LThumb1.kine.local.roty");
var rz = GetValue("Biped.LThumb1.kine.local.rotz");
SetValue("Biped.RThumb1.kine.local.rotx",rx,null);
SetValue("Biped.RThumb1.kine.local.roty",ry,null);
SetValue("Biped.RThumb1.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LThumb2.kine.local.rotx");
var ry = GetValue("Biped.LThumb2.kine.local.roty");
var rz = GetValue("Biped.LThumb2.kine.local.rotz");
SetValue("Biped.RThumb2.kine.local.rotx",rx,null);
SetValue("Biped.RThumb2.kine.local.roty",ry,null);
SetValue("Biped.RThumb2.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LThumb3.kine.local.rotx");
var ry = GetValue("Biped.LThumb3.kine.local.roty");
var rz = GetValue("Biped.LThumb3.kine.local.rotz");
SetValue("Biped.RThumb3.kine.local.rotx",rx,null);
SetValue("Biped.RThumb3.kine.local.roty",ry,null);
SetValue("Biped.RThumb3.kine.local.rotz",rz,null);

// Index
var rx = GetValue("Biped.LIndex1.kine.local.rotx");
var ry = GetValue("Biped.LIndex1.kine.local.roty");
var rz = GetValue("Biped.LIndex1.kine.local.rotz");
SetValue("Biped.RIndex1.kine.local.rotx",rx,null);
SetValue("Biped.RIndex1.kine.local.roty",ry,null);
SetValue("Biped.RIndex1.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LIndex2.kine.local.rotx");
var ry = GetValue("Biped.LIndex2.kine.local.roty");
var rz = GetValue("Biped.LIndex2.kine.local.rotz");
SetValue("Biped.RIndex2.kine.local.rotx",rx,null);
SetValue("Biped.RIndex2.kine.local.roty",ry,null);
SetValue("Biped.RIndex2.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LIndex3.kine.local.rotx");
var ry = GetValue("Biped.LIndex3.kine.local.roty");
var rz = GetValue("Biped.LIndex3.kine.local.rotz");
SetValue("Biped.RIndex3.kine.local.rotx",rx,null);
SetValue("Biped.RIndex3.kine.local.roty",ry,null);
SetValue("Biped.RIndex3.kine.local.rotz",rz,null);

// Middle
var rx = GetValue("Biped.LMiddle1.kine.local.rotx");
var ry = GetValue("Biped.LMiddle1.kine.local.roty");
var rz = GetValue("Biped.LMiddle1.kine.local.rotz");
SetValue("Biped.RMiddle1.kine.local.rotx",rx,null);
SetValue("Biped.RMiddle1.kine.local.roty",ry,null);
SetValue("Biped.RMiddle1.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LMiddle2.kine.local.rotx");
var ry = GetValue("Biped.LMiddle2.kine.local.roty");
var rz = GetValue("Biped.LMiddle2.kine.local.rotz");
SetValue("Biped.RMiddle2.kine.local.rotx",rx,null);
SetValue("Biped.RMiddle2.kine.local.roty",ry,null);
SetValue("Biped.RMiddle2.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LMiddle3.kine.local.rotx");
var ry = GetValue("Biped.LMiddle3.kine.local.roty");
var rz = GetValue("Biped.LMiddle3.kine.local.rotz");
SetValue("Biped.RMiddle3.kine.local.rotx",rx,null);
SetValue("Biped.RMiddle3.kine.local.roty",ry,null);
SetValue("Biped.RMiddle3.kine.local.rotz",rz,null);

// Ring
var rx = GetValue("Biped.LRing1.kine.local.rotx");
var ry = GetValue("Biped.LRing1.kine.local.roty");
var rz = GetValue("Biped.LRing1.kine.local.rotz");
SetValue("Biped.RRing1.kine.local.rotx",rx,null);
SetValue("Biped.RRing1.kine.local.roty",ry,null);
SetValue("Biped.RRing1.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LRing2.kine.local.rotx");
var ry = GetValue("Biped.LRing2.kine.local.roty");
var rz = GetValue("Biped.LRing2.kine.local.rotz");
SetValue("Biped.RRing2.kine.local.rotx",rx,null);
SetValue("Biped.RRing2.kine.local.roty",ry,null);
SetValue("Biped.RRing2.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LRing3.kine.local.rotx");
var ry = GetValue("Biped.LRing3.kine.local.roty");
var rz = GetValue("Biped.LRing3.kine.local.rotz");
SetValue("Biped.RRing3.kine.local.rotx",rx,null);
SetValue("Biped.RRing3.kine.local.roty",ry,null);
SetValue("Biped.RRing3.kine.local.rotz",rz,null);

// Pinky
var rx = GetValue("Biped.LPinky1.kine.local.rotx");
var ry = GetValue("Biped.LPinky1.kine.local.roty");
var rz = GetValue("Biped.LPinky1.kine.local.rotz");
SetValue("Biped.RPinky1.kine.local.rotx",rx,null);
SetValue("Biped.RPinky1.kine.local.roty",ry,null);
SetValue("Biped.RPinky1.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LPinky2.kine.local.rotx");
var ry = GetValue("Biped.LPinky2.kine.local.roty");
var rz = GetValue("Biped.LPinky2.kine.local.rotz");
SetValue("Biped.RPinky2.kine.local.rotx",rx,null);
SetValue("Biped.RPinky2.kine.local.roty",ry,null);
SetValue("Biped.RPinky2.kine.local.rotz",rz,null);

var rx = GetValue("Biped.LPinky3.kine.local.rotx");
var ry = GetValue("Biped.LPinky3.kine.local.roty");
var rz = GetValue("Biped.LPinky3.kine.local.rotz");
SetValue("Biped.RPinky3.kine.local.rotx",rx,null);
SetValue("Biped.RPinky3.kine.local.roty",ry,null);
SetValue("Biped.RPinky3.kine.local.rotz",rz,null);


Hope this helps anyone who encounters the same challenge.

earwax69
05-02-2009, 06:34 AM
Hi Asphalt, nice stuff. Its not exactly what I was searching but I think its interesting.

Me I just finished half my run cycle and was wondering if there is a tool for invert the first half of the run to the second half... mean the animation on the left side will become the animation of the right side.

guess I'll have top do it by hand...

byebye!

Stoehr
05-02-2009, 09:55 PM
Nice thinking! Congrats on your first script!

CGTalk Moderation
05-02-2009, 09:55 PM
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.