3ds Max Animation Techniques - Part 2 - Custom Attributes and Wiring
In this tutorial, learn how to create Custom Attributes to control object transforms, and particularly FK rotations. Forward Kinematics rotations can be extremely valuable for creating finger curls, pony tails or antennas on certain creatures. Here you learn how to properly control these rotations.
- Recorded in: 3ds Max 2012
- This tutorial is intended for use with 3ds Max version 2012 or higher.
00:00:00 --> 00:00:06
In the first movie of this series, you learned to create Custom Attributes
to control simple parameters.
00:00:06 --> 00:00:13
In this movie, you'll push the envelope further and learn to control transforms,
and in particular Rotations.
00:00:13 --> 00:00:23
FK rotations can be very handy for controlling finger curls or pony tails.
In this case, you'll use a custom attribute to deploy the wings on a bat.
00:00:23 --> 00:00:28
Before you start with this scene though, there are some basic concepts to cover.
00:00:28 --> 00:00:33
When you're dealing with wiring and transforms, you have to be careful how you proceed.
00:00:33 --> 00:00:40
You have to be mindful of your parent/child hierarchies,
and how Animation Controllers are set on objects you want to control.
00:00:41 --> 00:00:43
Let's simplify the bat example a little.
00:00:43 --> 00:00:49
In an empty scene, create a sphere in the top view. This will be the bat's body.
00:00:52 --> 00:00:57
Add an Attribute Holder modifier and a Float Slider custom attribute to it.
00:01:00 --> 00:01:01
You'll wire it in a second.
00:01:05 --> 00:01:10
In the Front View, create 3 or 4 bones to simulate a wing structure.
00:01:17 --> 00:01:26
Notice that because you created the sphere in the top view and the bones in the front view,
their local orientations are different.
00:01:28 --> 00:01:34
In particular, the Z-axis is pointing up on the sphere but aligned with the front view on the bones.
00:01:40 --> 00:01:44
Link the top bone to the sphere so that it travels with it.
00:01:53 --> 00:01:58
Choose Edit/Hold. You will need to come back to this point in a few moments.
00:01:58 --> 00:02:04
What you're looking for here is to control the local Z-rotation of the top bone (to start with).
00:02:06 --> 00:02:13
Wire the custom attribute to the Transform > Rotation > Z Rotation of the top bone.
00:02:18 --> 00:02:22
Make the direction one way so that the slider controls the bone rotation.
00:02:23 --> 00:02:27
Click on Connect and test the slider. You will notice two problems:
00:02:27 --> 00:02:34
One problem is that the rotation seems way too strong;
the other problem is that it's in the wrong axis.
00:02:34 --> 00:02:41
Let's examine one problem at a time: In 3ds Max, Rotations are calculated in radians.
00:02:41 --> 00:02:50
Even when you specify a rotation in degrees in the UI, such as when using coordinate entries,
internally, these are calculated in radians.
00:02:51 --> 00:03:00
In order for the wiring to work properly, you need to enter the expression "degtorad"
to apply the correct conversion.
00:03:00 --> 00:03:08
Set the expression to read "degtorad(Param1)" between parentheses, and update the connection.
00:03:13 --> 00:03:18
That's better as far as rotation value goes but it's still rotating in the wrong direction.
00:03:19 --> 00:03:27
That's because the bone is rotating in the parent space;
and since the Z axis on the sphere points up, the wing rotates around that direction.
00:03:27 --> 00:03:33
So, would it be better to wire the wing to a Y-rotation then, to match the direction of the sphere?
00:03:34 --> 00:03:42
Disconnect the link and choose to wire it to the Y-axis. Set the degtorad converter
and click Connect.
00:03:50 --> 00:03:58
Now it seems to rotate in the correct axis but it has shifted from its original position.
That's not something you necessarily want.
00:03:58 --> 00:04:01
Choose Edit/Fetch to go back to the starting point.
00:04:02 --> 00:04:08
The best thing to do in a case like this is to "Freeze" the object's original rotation or pose.
00:04:08 --> 00:04:13
Select one of the bones and verify the Rotation Controller in the Motion Panel.
00:04:13 --> 00:04:16
It is set to Euler XYZ which is the default.
00:04:17 --> 00:04:23
You need to change that to a List controller, basically a multi-layer rotation controller.
00:04:24 --> 00:04:30
This way, you retain the original pose, and then edit additional rotation layers.
00:04:30 --> 00:04:40
The easiest way to do this is to select an object or more, in this case all bones,
and then Alt+right-click and choose Freeze Rotation.
00:04:40 --> 00:04:45
Doing that creates a Rotation List controller to all selected objects.
00:04:50 --> 00:04:56
The first Rotation Controller, now called Initial Pose ensures the object is not offset when wired.
00:04:57 --> 00:05:00
The second controller is the one you can wire to your custom attributes.
00:05:01 --> 00:05:06
The "Available" track is ready in case you want to add more rotation layers to the mix.
00:05:16 --> 00:05:24
A note is worth mentioning here about the Freeze Transform option which adds
a Controller List to both Position and Rotation.
00:05:25 --> 00:05:28
In this case however, you only need to worry about rotations.
00:05:29 --> 00:05:35
Back to the wiring part; wire the slider to the rotation in Z of the SECOND controller.
00:05:42 --> 00:05:44
You want to leave the initial pose alone.
00:05:44 --> 00:05:52
Notice also that using this method, you only need to worry about the local orientation
of the object, and not its parent's.
00:05:52 --> 00:05:58
Choose the wiring direction, enter the degtorad converter and click Connect.
00:06:04 --> 00:06:11
In the next and last movie, you apply this technique on multiple bones to deploy the wings of a bat.