PDA

View Full Version : mel newbie question


modi
12-21-2003, 09:52 AM
Is there a way to globally set a value using mel for my controls, say i want to subtract 90 degrees in y from my Root and my legs. thanks.

K , i figured that out, but din't work for what i wanted it to. Well , before i started my animation, i rotated the ALL control (the nurbscircle with all the controls grouped under this to move the character around) 90 degrees in Y. I've already begun animating my character and what i want to do now is zero out the rotation on the ALL control and transfer that to the root node and the legs. Basically i don't want the animation to change. Just zero out the rotation and transfer those to its children. Any ideas?

MikeRhone
12-21-2003, 11:08 AM
Being that an objects position is calculated from its parents position, there wouldn't be any direct way to have a MEL reposition the legs and feet in the way you would like.

A few options:

Zero out the ALL control as you would like, and parent (Or parent constraint) the ALL control to a new node. Then rotate that node as you need.

Manually reposition the feet and root/cog. Being that there are only a few curves to adjust, it shouldnt be too dificult.

Now keep in mind that if you are using Maya's default rotation order (XYZ), when you rotate the root or ALL controls 90 degrees in Y you will achieve full gibmal lock. Personally I would keep all rotation-Y animation on a seperate parent.

I hope this helps!

Mike R

macaroniKazoo
12-22-2003, 09:04 AM
modi: i wrote a script awhile back that should do that for you.

it might be a little tricky, but the script will definitely do it for you. download it here: zooXferAnim (http://www.macaronikazoo.com/mel/download/zooXferAnim.zip).

basically what you'll have to do is this. save out your scene under a new name. now reference your original scene into this new scene. now you should have your character appearing twice (one from the scene, one from the reference). ok, now delete all the animation on the non referenced char, and zero the global control.

now load the script by typing: zooXferAnim.

now load all the controls from the referenced scene into the source pane, and all the controls from the normal scene into the target.

make sure the mapping figured itself out. if not, you can change which object is mapped to which (read the help for more info).

now, change the xfer mode (down the bottom) to trace, and turn on world space. you also want to do a sequence, and trace keys only (read the help to find out more about it if you want). then just press the xfer animation button, and it should trace the animation from the reference onto the rig in the scene. if you've zeroed out everything you wanted to, it should all be good.

in theory of course. :) best of luck...

macaroniKazoo
12-22-2003, 09:09 AM
modi: it seems my web server is currently having issues, so if its still dead when you need the script, just private message me ur email, and i can mail it to you if u want...

modi
12-22-2003, 08:08 PM
just got your email, thanx a ton, i'll check it out at home later on tonight and let you know how it worked. Thanks again.

Ckerr812
06-03-2004, 05:44 PM
Originally posted by macaroniKazoo
modi: i wrote a script awhile back that should do that for you.

it might be a little tricky, but the script will definitely do it for you. download it here: zooXferAnim (http://www.macaronikazoo.com/mel/download/zooXferAnim.zip).

basically what you'll have to do is this. save out your scene under a new name. now reference your original scene into this new scene. now you should have your character appearing twice (one from the scene, one from the reference). ok, now delete all the animation on the non referenced char, and zero the global control.

now load the script by typing: zooXferAnim.

now load all the controls from the referenced scene into the source pane, and all the controls from the normal scene into the target.

make sure the mapping figured itself out. if not, you can change which object is mapped to which (read the help for more info).

now, change the xfer mode (down the bottom) to trace, and turn on world space. you also want to do a sequence, and trace keys only (read the help to find out more about it if you want). then just press the xfer animation button, and it should trace the animation from the reference onto the rig in the scene. if you've zeroed out everything you wanted to, it should all be good.

in theory of course. :) best of luck...

Hey there,

I was trying out the zooXferAnim script in maya 6.0, do you know if it works in Maya 6?

I keep getting this warning,

zooAnimFile.mel line 248: Converting string "" to an int value of 0. //

And worst of all nothing gets transfered :(

Just wondering if it's something I am not doing wrong, or if the script needs to updated for maya 6.0?

Thanks :)

Ckerr812
06-03-2004, 05:50 PM
hmm...actually..spoke to soon, it only gives me that warning, when I write the source objects to a file and then import them in, if they are in the same scene seems to work well....

hmm..Interesting....

macaroniKazoo
06-04-2004, 01:11 AM
if you're getting errors importing animation, chances are the exported animation file is empty. remember, the script exports animation from selected objects ONLY. check out the help for more info, and if it still gets the error, try opening up the exported animation file. if theres stuff there, and you still get errors, send me an email, or PM or something...

oh and i just updated the script this morning, so download it, just so i know you have the latest. :)

cheers!

Ckerr812
06-04-2004, 03:26 AM
Howdy,

Yea, it works great if I reference the scene with the rig, but writing to file then importing I am having alot of trouble with.

I'll PM you tommorow with more details of some little glitches, I didn't really have to much time today to sink my teeth into it and get the text editor out and take a look under the hood. So basically I just referenced the file to the scene and Xfered from there and all was good. Saved me alot of time.

another nice script BTW, keep up the good work.

macaroniKazoo
06-04-2004, 03:34 AM
yeah, definitely send me mail if something isn't working for you. i use it pretty regularly, and its been super solid, but if its not working for others, then theres a good chance that i've done something wrong with the release. either that or i could make it easier to use. :)

CGTalk Moderation
01-17-2006, 12:00 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.