Showing posts with label MEL. Show all posts
Showing posts with label MEL. Show all posts

Friday, September 29, 2017

Zero-out Rotation Axis in Maya

Recently while working on some rigs, I was needed to strictly move the current skinned finger joints position to match a newly given set of finger joints by another TD. Usually, we should receive nicely oriented joints but it was not the case. Not only the rotations and joint orient values are messy, but there is also rotation axis value. If I were to directly snap to the new joints (following its translation + rotation), my joints will be messed up too.

It has been awhile since I last dealt with such a problem, so I forgot I solved it. Thanks to Goggle Search, someone has shared their solution, so I thought more people can benefits from it.

Basically, it is a short script to zero-out Rotation Axis in the joint without affecting the rest of the children joints. Pretty need and simple. Just select the joints that you would like to zero out the rotation axis values, and run this:

joint -e -zso;

Voila! It worked flawlessly. I think my old method required a bunch of calculations but this is magical. Hope it helps.

Thank you to Oana Jones for this sharing at :

http://oanajones.blogspot.my/2013/08/zero-out-rotation-axis-in-maya.html

Wednesday, December 15, 2010

IK Spring Solver

IK Spring Solver is useful when posing and animating limbs that have numerous joints such as insect legs. The most prominent function is the ability to adjust the spring angle bias to keep the joint angles to be evenly distributed. To use this IK solver, it has to be activated through an easy MEL script:

ikSpringSolver

Through the Internet, there are many people who bumps into problems while using this IK Solver, especially when performing world rotation that seems not to affect the joints rigged with IK Spring Solver. This problem has been a plague since Maya 7.0 and no rectification is being done up till Maya 2009 (which I am using) to make it behave properly.

The only available fix to it, is to have the first joint of a series of joints bounded to an IK Spring Solver not to be parented to its whatever parent. That joint shall be parent constrained to whatever parent it supposed to be, instead of directly parented underneath them. 

Note that IK Spring Solver will also break if you choose to parent the joints under a transform node and choose that transform node to perform the required parent-constraining. It is okay if you parent constrain the joints to whatever parents it supposed to be as described above, and group the joints in an empty transform node for clarity purposes. 

I guess that is as much as I could explain. Please do drop a message if the problem persists, or my instructions being unclear.

Wednesday, February 10, 2010

'File contains unknown nodes or data'

Some people happens to run into a problem when trying to save a Maya Binary (.MB) file to Maya ASCII (.MA) file. An error message would pop up mentioning, 'File contains unknown nodes or data. To preserve this information, the current file type cannot be changed.'

In this case, you can write this MEL script to look for the 'unknown' node(s):

ls -type unknown;

A list of unknown node(s) will be generated.
You can delete them by typing:

delete `ls -type unknown`;

By deleting the unknown nodes, the problem should be solved. =]

 UPDATED 12.01.2010 :
Thank you to Ariel for adding extra info.
If it says "Cannot delete locked node", make sure you get the name of that node and select it, and then type:

lockNode -l 0;
Then type again:

ls -type unknown;
delete `ls -type unknown`;

That should do it.