View Full Version : Flip complete character animation (same action/opposite side)
KingMarcus
06-05-2008, 11:53 AM
Hi, I would like to know if there's in XSI an easy way to reuse a character animation and "flip" it to the opposite side.
I mean, if (for example) I have a character punching with his left arm and kicking with his right leg and facing West, I then need to reuse this completed animation and have him facing East and punching with his right arm and kicking with his left leg.
Same with any other animation, for example, him jumping over a wall, etc.
I've played with templates, the mixer, animation editor, but haven't found a productive way to achieve that, without a lot of work of copy/paste curves and inverting them.
Any ideas here??
Thanks.
-KingMarcus-
-----------------------
KingMarcus
06-08-2008, 07:55 PM
Hi, maybe the correct word would be "mirror" the animation.
Any help here??
Thanks.
BloomPix
06-10-2008, 07:28 AM
Hi Marc,
seems a difficult question! No answers...
DAVID:-D
06-10-2008, 08:46 AM
you need some scripting to make it work.
Mostly all you can do manually u can make a script to do for yourself.
So far I can help u more.
septopus
06-10-2008, 02:58 PM
you can create clips in the mixer from your animations
i think xsi has options to reverse or mirror animations.
in the source properties
KingMarcus
06-11-2008, 12:35 AM
Hi, again.
As far as I know there are options in the mixer to invert the clip and other "editing-like" functions, but there aren't any options to mirror the entire animation. However, maybe you can add expressions to the source clip, affecting the eskeleton.
But I don't know what kind of expressions would work there to achieve the desired effect. Any idea?
Thanks again for your replies.
----------
BloomPix
06-12-2008, 04:03 AM
Hi,
keep looking for this thread in XSIBase beacause it asks about the same. There is no answer yet, but will help to doublecheck:
http://www.xsibase.com/forum/index.php?board=11;action=display;threadid=36423
jamination
06-12-2008, 05:04 PM
I believe the 3dquaker rig had this function built in, however, I wouldn't recommend it for production as I could never get reliable results with the guide to rig. It would be nice if this type of functionality is built into a future release of XSI.
3DMastermind
06-13-2008, 01:25 PM
Unless I'm mistaken...
Parts of rigs (like arms) in XSI, are usually "symmetrised" with "duplicate symmetry" , however the "negative scaling" must be turned "off" for mirroring to function.
Perhaps, I should ask to make this the default...
If this was not done during the rigging process... I highly recommend that you redo the arm to get the mirroring to function.
This way you can simply copy and paste the animation over to every bone, just like the XSI "biped rig".
You can then make a script to copy the animation of every selected bone over or simply do it once manually and save your .vbs ;)
lookslikematt
07-10-2008, 04:46 PM
Thanks, Manny! Is there anywhere that the neg. scale might cause issues?
Cheers,
Matt
MahtiKebab
10-14-2008, 12:25 PM
Hi,
a mirror pose/animation should most definitely be implemented in the xsi default biped rig. This is a huge time saver in game animations. Also it should be simple and useful to make some sort of taggable system for xsi to understand a custom rig structure to mirror it properly, although when creating own rigs one usually implements this kind of behaviour by himself via scripts.
Anyways, what I've done is that i've made a very simple script that stores the rotations on bones i use for FK and stores the rotations+translations on control objects i use for IK. I use this for every pose i've created and then tweak the fcurves. In JScript this is simply done by:
var oObj = "Biped";
var j = GetValue(oObj + ".RBicep.kine.local.rotz");
SetValue("Biped_Rig.LBicep.kine.local.rotz", j, null);
This stores the right biceps z rotation in a variable j and applies it to the left bicep. Very simple. Do this for both sides of the body and then set the opposing sides values from your stored values. Upperbody like spine and neck etc will only have some of their values as negative. For example some rotations just need to flip and on some you don't have to do anything. You can flip the value by multiplying it with -1, to get clearer parameters on the SetValue operation i suggest you use variables for this, for example:
var jInverted = j * -1;
You have to go through each bone and control object and check what values should be inverted and what shouldn't. For example movement in Y direction most likely doesn't need to be inverted for the hip control obj etc. This doesn't mirror the whole animation itself, rather it's applicable for pose-to-pose animations. Way better than redoing everything atleast :)
Thanks for the Script tips MahtiKebab and yes I also think that a mirror Pose/Animation should definitely be implemented in the default Biped rig, its about time :p
MahtiKebab
10-21-2008, 09:02 AM
Np. To speed up the flipping thing you could make a script that goes through every keyframe, uses the mirror/flip script and sets a key on for example a character key set. That way you would get a whole clip mirrored pretty easy. I don't have this script yet at hand so I cannot paste anything here, but I'm about to write it soon.
Already passed the info to the Scripts guy :)
Thanks once again MahtiKebab
Husch
10-23-2008, 09:07 AM
When someone has a script like this for the default rigs of XSI (made from guides) could he please post it here? I am working on a project with a lot of mirrored animations and I really need a script like this. Unfortunately I am just a 3D Artist and donīt know nothing about scripting.
mantom
10-23-2008, 08:40 PM
If you're smart with your rig setup and make all the bone orientations exact mirror copies of each other between right and left halves, you can use connection templates in the animation mixer to map actions from right --> left sides and vice versa. Otherwise, you have to get into value offsets per parameter, and then it gets messy.
If you don't want to go that route, you can use parameter tagging to ID which parameters should be associated with each other, then use scripting to do the copy/paste between halves using the tags.
Matt
Husch
10-24-2008, 06:58 AM
Thank you very much mantom. I didnīt know about the power of Connection Templates. I made a template mirroring the arms and the legs of a rig and it works great. Now I want to make a connection template for the controllers in the middle of the rig (using Quaternion spline for the torso): UpperBody, HipDepth, ChestDepth, Chest, Neck, Head
Is it possible to multiply a rotaion or position value by -1 and mirror the animation inside the connection template?
I tried
Map From: UpperBody.kine.local.rotx
Map To: UpperBody.kine.local.rotx * -1
but it does not work. Anyone can point me in the right direction?
mantom
10-24-2008, 01:43 PM
When you instance an actionsource onto the mixer timeline, you effectively create an actionclip. Inside the actionclip are 'clipitems' (inspect the properties of the clip). One of the supported values of an action clip is the offset map (sometimes labeled 'relation'). this is where the offsets reside. The offsets can be explicit values or expressions using the 'this' keyword to reference the value stored in the clip for the affected parameter. You can apply them in the actionclip prior to transfer, or you can apply them afterwards after the transfer has been made. Just matters how much work you want and when you want to deal with it. If you don't use the mixer for transfer, then you'll have to do it with scripting.
Husch
10-27-2008, 09:31 AM
Thank you mantom. I have managed to mirror my animation clips with the combination of a connection template and a mapping value template.http://www.huschang.de/pimp/mapping.jpg
I still donīt know why the strings on the left side of the value mapping template
becomes red after validating, but it works great. So if anybody here has to mirror animation clips on a default xsi biped you can use these templates in the animation mixer to mirror the whole animation. You can download these templates here: http://www.huschang.de/pimp/xsi_mirror_biped_animation_clip.zip
Hope it helps anyone.
mantom
10-27-2008, 12:47 PM
I still donīt know why the strings on the left side of the value mapping template
becomes red after validating, but it works great.
Probably because you stored animation data for both right and left halves of your character in the same actionsource. It may be creating a dependency cycle where the left half maps to the right, but simultaneously the right is mapping to the left. The result of the right half cannot be determined until the left half has been evaluated because your expression references the left half, but the left half cannot be determined until the right half has been evaluated because the left half references the right half.
You should consider storing 2 actionsources instead of one - each source containing only one half of the character.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.