& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Use Mel scripting to apply the correct rotate order to the remaining joints for the entire skeleton.
Type:
Tutorial
Length:
3 min.
Transcript
00:04
So now we have a rotate order which works better than XYZ.
00:08
We need to apply it to the rest of the skeleton.
00:12
Now, you could go through each joint and set the rotate order manually.
00:15
But I have a much quicker way of doing it.
00:18
I'll just open the script editor
00:22
if I move these over
00:24
and I'll just change the rotate order attribute
00:27
and then change it back.
00:31
What you can see now is that Maya has given us the code. We need to do this using mel.
00:37
The four represents the number of the item in the drop down box, 01234.
00:45
They always start with zero, not one.
00:48
If I copied this now and ran it,
00:49
it would set the rotate order for me on the lower arm joint.
00:53
So we need to turn this into something which will work on every joint in the skeleton,
00:57
which is where this little piece of mel script comes in.
01:01
Let's select the root joint, which is a first in the hierarchy.
01:06
First, we need to find a list of all this joint Children.
01:09
We can do this using the list relatives, command
01:13
the type flag.
01:14
With the minus next to it tells mayor we just want to look for joints.
01:19
The minus ad flag will search through all descendants.
01:23
So everything in the hierarchy.
01:26
If I select just that and run it,
01:29
we get a list of all the joints.
01:34
What we can do is store that list in a variable
01:37
like this one which we call joint list.
01:40
It can be any name you like. It's just something to store that list.
01:45
Now we have a list of the joints stored.
01:47
We can use a four loop to go through each joint in the list. In turn.
01:52
So for joints in joint list,
01:54
joints will represent each item in the list.
01:58
We can then run the code to change the rotate order.
02:01
But we need to replace the name of the joint with the current joint in the list
02:06
or it's just gonna be repeatedly updating that one joint.
02:10
So what we can do is use the joint variable
02:14
and add the attribute to the end
02:18
and then set it to four, which is YXZ.
02:22
If I select that now and run it, it will update all the joints in the hierarchy.
Video transcript
00:04
So now we have a rotate order which works better than XYZ.
00:08
We need to apply it to the rest of the skeleton.
00:12
Now, you could go through each joint and set the rotate order manually.
00:15
But I have a much quicker way of doing it.
00:18
I'll just open the script editor
00:22
if I move these over
00:24
and I'll just change the rotate order attribute
00:27
and then change it back.
00:31
What you can see now is that Maya has given us the code. We need to do this using mel.
00:37
The four represents the number of the item in the drop down box, 01234.
00:45
They always start with zero, not one.
00:48
If I copied this now and ran it,
00:49
it would set the rotate order for me on the lower arm joint.
00:53
So we need to turn this into something which will work on every joint in the skeleton,
00:57
which is where this little piece of mel script comes in.
01:01
Let's select the root joint, which is a first in the hierarchy.
01:06
First, we need to find a list of all this joint Children.
01:09
We can do this using the list relatives, command
01:13
the type flag.
01:14
With the minus next to it tells mayor we just want to look for joints.
01:19
The minus ad flag will search through all descendants.
01:23
So everything in the hierarchy.
01:26
If I select just that and run it,
01:29
we get a list of all the joints.
01:34
What we can do is store that list in a variable
01:37
like this one which we call joint list.
01:40
It can be any name you like. It's just something to store that list.
01:45
Now we have a list of the joints stored.
01:47
We can use a four loop to go through each joint in the list. In turn.
01:52
So for joints in joint list,
01:54
joints will represent each item in the list.
01:58
We can then run the code to change the rotate order.
02:01
But we need to replace the name of the joint with the current joint in the list
02:06
or it's just gonna be repeatedly updating that one joint.
02:10
So what we can do is use the joint variable
02:14
and add the attribute to the end
02:18
and then set it to four, which is YXZ.
02:22
If I select that now and run it, it will update all the joints in the hierarchy.
Industry:
Role:
Sign in for the best experience
Save your progress
Get access to courses
Receive personalized recommendations
May we collect and use your data?
Learn more about the Third Party Services we use and our Privacy Statement.May we collect and use your data to tailor your experience?
Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.