PDA

View Full Version : ? Mirror Motionclips ?


ljilekor
10-28-2003, 04:05 PM
How can mirror motionclips with messiah animate 3.3b?:banghead:
I've animated half a walkcycle and I want to mirror this animation to the other half of the body.

In the old Messiah 1.5.7 it was no problem. Select the objects you want to mirror, match them to the bones on the opposite side(different group), flag the mirror button and paste the motion. offset motions if needed.

I can't imagine it doesn't work in the new versions. It would really, really be a step back.:thumbsdow

ljilekor
10-28-2003, 07:38 PM
Does no one know or am I just stupid (or blind maybe)?

lmilton
10-28-2003, 07:55 PM
You're not going insane. I just checked and there is no mirror option in Compose->Clips. I might have been able to knock out a quick mirrormotion Edit plug, but 3.3 wouldn't be able to load the plugin (only 4 can load it).

The only option I can think of at the moment (I'm pressed for time) is for you to apply the motion to the other side of your character, select the channels that you want to mirror (usually just x, h, b) and enter -1 into the Scale Value param of Distort Key Range. If I think of something else, I'll try to post.

-lyle

ps: we'll add the mirror feature in a m:a 4 patch.

ljilekor
10-29-2003, 09:57 AM
Aaaaaaaaargghhhh. Mirroring with x,h,b was exactly what I wanted to avoid. Life sucks.

It would be helpful to have a plugin for Messiah 4. I'm planning to buy it anyway.
If it works like in the old 1.5.7 and if it's group independent it would be perfect.

Match hierarchy! Example: L_Arm with R_Arm by just selecting the L_shoulder, copying the hierarchy motions, selecting the R_shoulder, Match hierarchy and then replace, paste or insert the motions.

This could all be done in some kind of virtual or temp mcp. (Just like in 1.5.7) because most of the time those mcps are only temporary.

You could add the option to mirror on the Y and Z Axis too. (Just because nobody else does it). It could be helpful in some cases.


And most of all. DON'T FORGET TO ADD IT IN THE NEXT RELEASE OR UPDATE.:shame:
It's very very basic and very very very helpful.

ljilekor
10-29-2003, 04:48 PM
Mirroring every key is a hell of a job.
People told me I'm became very aggressive after I mirrored a whole walkcycle. I don't really remember because I was in some kind of trance. :surprised
I've been thinking about hiring a baboon to do the job.

I also tried
- animating half a walk,
- creating a group all animated items,
- matching every item to its opposite part (except for the pelvis, spines, head),
- track composite operator and compensation are set to =
- setting the factors of all items to channel only and multiply x,h,b with -1.

Normaly the mcp should be mirrored. ??? But I get strange results.
If it works this way, it would save me a great amount of time.

How come I don't get the right result ???
Help me out, before I kill someone. Or before the RSPCA sews me for torturing baboons.

lmilton
10-30-2003, 02:00 AM
Originally posted by ljilekor
Mirroring every key is a hell of a job.
People told me I'm became very aggressive after I mirrored a whole walkcycle. I don't really remember because I was in some kind of trance. :surprised
I've been thinking about hiring a baboon to do the job.

I also tried
- animating half a walk,
- creating a group all animated items,
- matching every item to its opposite part (except for the pelvis, spines, head),
- track composite operator and compensation are set to =
- setting the factors of all items to channel only and multiply x,h,b with -1.

Normaly the mcp should be mirrored. ??? But I get strange results.
If it works this way, it would save me a great amount of time.

How come I don't get the right result ???
Help me out, before I kill someone. Or before the RSPCA sews me for torturing baboons.

Using the factors is a great idea. Can you post a sample scene so I can see exactly how you're using it?

ljilekor
10-30-2003, 03:19 PM
Aajt!
Cool you take the time to examine my problem

Here,s my scene with a default Character setup of a basic walkcycle. Logicaly seen, it should work. But it doesn't.

It's made in Messiah Animate v3.3b.

Pt1 = f01-f10 : keyed animation.
Pt2 = f20-f30 : Motionclip of animation f01-f10.
Pt3 = f30-f40 : Mirrored Motionclip of animation f01-f10.

Pt1 is half a walkcycle.
Pt2 is a motionclip I made out of Pt1. Source group, All Channels, Animation, Range (1-10)
Pt3 is a motionclip I made out of Pt1 (I made a new copy cuz matches are made on motionclip level not on the instances). With the opposite items matched (except for pelvis spline, head) and the Factors on channels only set to -1.0 for x,h,b

In Pt2 the factors are doing something. But not what they logicaly must do when x,h,b are set to -1.

I'm quite stuck here.
This method is a big pile o' shait though, compared to a mirror mcp button (that takes the matching in account). Just like in the good ol' 1.5.7. I'm so used to the mirror button that I really feel helpless without it.

Peace in the middleEast, thanks again for checking this out.:buttrock:

ljilekor
10-30-2003, 03:27 PM
Attachment doesn't work for some stupid reason. Could you pass me ur email? U can do it in private reply. I promise not to bother u with stupid questions later on.

lmilton
10-30-2003, 07:38 PM
You can reach me at my projectmessiah.com address. My username is "lyle". Put it all together and you have my address;)

-lyle

ljilekor
10-31-2003, 11:17 AM
By the way, I have Messiah Studio 1.5b now. Would be very gratefull if you could send me the mirror mcp plugin.

ljilekor
11-18-2003, 05:33 PM
:bounce:
mirror plugin / script ???

preproduction is almost over. I'm gonna die in production without the mirror(hierarchy) tool.:cry:

lmilton
11-18-2003, 07:18 PM
Originally posted by ljilekor
:bounce:
mirror plugin / script ???

preproduction is almost over. I'm gonna die in production without the mirror(hierarchy) tool.:cry:

Do die!! Here's the script code to perform the mirroring:

------------------------------------------------------------------------------
int do_obj(object obj)
{
int i;
int num_keys;
double v;

i = 0;
num_keys = NumKeys(obj);

while (i<num_keys)
{
//xpos..................................
v = GetKeyValue(obj, i, 0);
v = -v;
SetKeyValue(obj, i, 0, v);

//heading...............................
v = GetKeyValue(obj, i, 3);
v = -v;
SetKeyValue(obj, i, 3, v);

//bank..................................
v = GetKeyValue(obj, i, 5);
v = -v;
SetKeyValue(obj, i, 5, v);

i = i + 1;
}

return (num_keys);
}
------------------------------------------------------------------------------
If you're familiar with scripting, you can see that there isn't much to it. Just in case you're not, I've attached the actual script. Just unzip it to your scripts directory, and it will be available in the scripts palette when you start messiah.

Note that I've included other functions that you can use in other scripts, if you like. And you might find it more desirable to use the script with an armature menu (similar to Thomas Helzle's on Zoogono.com).

Anyway, let me know if this works for you.

-lyle

ljilekor
11-20-2003, 02:21 PM
Thanx a lot.
The mirrorscript mirrors the motion of an object

But I'd like to copy AND mirror from one object to another. (eg. copying the motion of my left arm to the right)
If possible I'd like to do it within a given range. (eg. from frame -10 to frame 56) with a given offset.

I tried to alter the script myself. I'm quite familiar with scripting in other softs but I never had the time to script with messiah.

Here's what I did.(I isolated the problem(sorry for the mess))

//#messiahscript

#define SCRIPT_LAUNCH_ACTIVATION 1

_//Main
_int main(object obj)
_{
_ object next;
_ next = GetFirstSelectedObj();
_ do_obj(obj,next);
_ return (1);
_}
_
_//mirror a specific object,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
_int do_obj(object master,object slave)
_{
_____int i;
_____int num_keys;
_____double v;
_____i = 0;
_____num_keys = NumKeys(master);
_____
_____//Copy master keys to slave keys
_____CopyChan( slave, master, "111 111 111 000", "000 000 000 000" );
_____
_____while (i<num_keys)
_____{
__________//xpos..................................
__________v = GetKeyValue(master, i, 0);
__________v = -v;
__________SetKeyValue (slave, i, 0, v);
__________
__________//heading...............................
__________v = GetKeyValue(master, i, 3);
__________v = -v;
__________SetKeyValue (slave, i, 3, v);
__________
__________//bank..................................
__________v = GetKeyValue(master, i, 5);
__________v = -v;
__________SetKeyValue (slave, i, 5, v);
__________
__________i = i + 1;
_____}
_____return (num_keys);
_}
_

I changed just 1 little thing and (guess what) nothing worx anymore.
I added an argument to the function. This is the object I want to copymirror the motion from (master). object next is the object that will receive the mirrored motion (slave)
In order to do this, I copy the motion of my master to my slave with the CopyChan() function.
Then I just need to mirror the keys and...

BLANG there goes my enthousiasm. the CopyChan() doesnt execute. ????
What am I doing wrong.:bowdown:

lmilton
11-20-2003, 09:28 PM
CopyChan doesn't copy keys, it copies the current channel (motion) values from on object to another.

You can't currently create keys in scripts. So, the script that I created for you was intended only to mirror motion channels. I put this script together for you because you indicated you were in a crunch in production; we come from a production background, so we know how it is. And as such, sometimes you have to resort to (apparently) ineligant solutions.

So, if you're really in a crunch, use Compose to copy the keys from one hierarchy to another, then use that mirrormotion script to mirror that second hierarchy. Sure, it's not as direct as a "one source" solution, but it will definately get the job done.

If you're not in a crunch, then the key copy/mirroring feature will be in the next patch (scheduled for next week).

Take care,

-lyle

gsuttor
11-21-2003, 02:06 AM
Cool! a patch next week.... woot! :D

Sil3
11-21-2003, 07:27 AM
Originally posted by gsuttor
Cool! a patch next week.... woot! :D

:bounce: :buttrock: :bounce:

ljilekor
11-21-2003, 09:55 AM
That's what I suspected about the CopyChan() function.

Anyway, Big Up Lyle bluck! bluck! :buttrock:

We're all really looking forward for da nexxx patch.
I believe I can fly, I believe I can touch ... (cut the crap)

Can you reveil some other new features to us, your humble, drooling users :drool:

Qslugs
11-22-2003, 07:32 AM
I know I am late to the conversation here but this is an exact issue that I had while using Maya during the last game I worked on. The problem is that Maya also has no way to natively mirror a motion. The way I got around the issue was something like this:

I set up a scene with two copies of the characters skeleton.

A source skeleton and a target skeleton.

Once I had thoes two characters loaded I went through each joint and set up expressions so that the rotations of the joints were mirrored negatively on the proper opposite axises from the source skeleton to the target.

The expressions I used were very basic. A basic example using what I think I remember from the maya way of doing things would look something like this:

L_elbow.rotx = R_elbow.rotx *-1;

(I do realize that messiah syntax is a bit different btw, same concept though)

It took a while to figure out which joints got driven by negative values and which did not, not all the joints were effected at all.

An example of this would be the spine. Mainly from directly above the root(or pelvis) to the top of the head. The only channel that would not be effected in the spinal column would be the Pivot. That would be the direction one would head if one were to take a bow. If I were to multiply the spine bones on the Pivot by -1, the character would be hyperextending its spine. Which is definately not the desired effect. So for all the bones chained directly above the root I made no expression for the "P" channel.

This was definately a bit of a pain to initially to set up an entire skeleton, linking the one to the other, however the end results worked perfect.

To further explain what I did here's exactaly how the scene functioned once it was complete.

Load scene that needed mirrored motion.

Select all joints on the model and copy the required pose OR number of frames in the animation to be mirrored.

Close scene and open up the mirror scene.

This scene has two skeletons; one to recieve the source frames from the animation needing mirrored, and the other to recieve the frames (via expressions on all the joints) after the mirroring has occured.

The next step is to simply paste the frames (copied from the previous scene) onto the source skeleton, this in turn (via expressions) causes the motion to mirror on our target skeleton.

From there you select all joints in the scene and bake the entire animation range for all the joints. In addition, this process also gets rid of all the expressions; in Maya you cannot to my knowledge share animation of an item with both keys and expressions at the same time.

After this you simply select all the joints on the target skeleton and do a ctrl c, or copy.

Then the scene is closed, the original scene is loaded.

Select all the joints on the original skeleton, then paste the new values back onto the old skeleton.

In essence what I was able to accomplish in about 3 hours of setup is a scene that also functions as a tool.

Not a substitution for a mirror button on the interface, hower it worked well and was quite easy to set up. Something like this could definately be set up in messiah no problem.

Julez4001
06-21-2005, 07:05 PM
Okay, found the mirror tab n the Clips tab under Compose.
Trying to mirror pose (which are one frame motionclips).
Has anyone done this.


Would Fix Symmetry do this?

CGTalk Moderation
06-21-2005, 07:05 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.