This page covers usage of all the “Bone” related nodes. in order to use these you will have to add the bones.py file in the release of My-AN-Nodes into the sockets folder of Animation Nodes, or these will not work as there are no bones sockets in standard AN.
Here are the nodes:
You will note the pale blue socket colours, these denote “Bone” type sockets, either a single bone, or a lists of bones. The first two nodes get bones from an armature to feed into various transform nodes; to move, rotate or scale the bone(s).
The “Bone From Armature Object” and “Bones From Armature Object” nodes are almost identical in look and purpose, the only difference being one returns a single bone, the other returns a list of bones.
The nodes have the following inputs:
- Search String (Text)
- Armature (Object)
The node will test that you have plugged an Armature object into it and will pull your arm off and beat you with the soggy end, if you have used any other type of object. The nodes have the following output:
Either of:
- Single Bone (Bone)
- List of Bones (Bone List)
If you enter no search string, the Single Bone option will be the first bone in the armature’s list, and the Bones option will be a list of all the armature’s bones. The search string method is “starts with” so if you enter crank- the bone(s) given will start with the characters crank-. The node will tell you how many bones match your search criterion.
Note: Criterion is the singular of Criteria – if there is only one of these you use the singular not the plural. Jeez have all the young ones forgotten basic Latin!!!!
The “Bone Transforms Input” and “Bone World Transforms Input” nodes both work in a similar fashion, except for what is output from them.
The nodes have the following input:
- Bone (Bone)
And the following outputs:
Either:
- Bone (Bone)
- W-Location (Vector)
- W-Rotation (Euler/Quaternion)
- W- Scale (Vector)
Or:
- Bone (Bone)
- Location (Vector)
- Rotation (Euler/Quaternion)
- Scale (Vector)
Here is a typical use with Viewers to show the various outputs:
Bone Transforms shows the “Local” transforms of the bone(s). Bone World Transforms show the global position of the bones assuming the armature’s location is 0,0,0. As it is not, I have used Vector Math node to add the location of the Armature so I get the true World position of the bone selected. You can also see the number of bones that satisfy the search criterion.
The various Bone Transform Nodes all work in a similar fashion, so I shall describe them as a group, here is a picture:
This node setup rotates all bones whose name begins with the letters crank by 4 degrees every frame of the animation.
The nodes have the following inputs:
- Use Degrees (Checkbox) Rotation node only
- Single Bone (Checkbox)
- X-Loc, Y-Loc, Z-Loc (Float) Location node only
- W-Rotation, X-Rotation, Y-Rotation, Z-Rotation (Float) Rotation Node only
- X-Scale, Y-Scale, Z-Scale (Float) Scale node only
If Single Bone is checked, the node expects a single Bone as an input, if not checked the nodes expects a Bone List. The node will apply any transform to all bones in a bone list. The differences between the three nodes otherwise should be obvious!
If Use Degrees is not checked, the node assumes it is getting Radians not Degrees, remember a Radian is 360 degrees divided by 2 times pi. Use degrees if this is too confusing. 😛
The last two nodes are similar to the Copy .. With .. Nodes in the Object section in that they take the transforms from one bone and apply them with offsets (can be 0 of course, then it becomes a Copy Transform Constraint look-a-like) to a list of other bones. A typical usage:
This setup moves all target bones 2 units above the source bone along the bones’ Z axis. It also rotates the target bones 20 degrees more than the source bone along their X axis increasing 20 degrees every 30 frames. Ha! clever yes? The Expression nodes uses Integer Division (//) to divide the current frame by 30, so it only increases every 30 frames, and then multiplies the integer by 20.
The nodes have the following input:
- X-Loc, Y-Loc, Z-Loc (Float) Location node only
- W-Rotation, X-Rotation, Y-Rotation, Z-Rotation (Float) Rotation Node only
- Source Bone (Bone)
- Target Bone(s) List (Bone List)
- Offset (Vector) Location node only
- Offset Euler (Euler) Rotation node only
- Offset Quaternion (Quaternion) Rotation node only
So these nodes should have the appropriate checkboxes set for what transforms you want to take place, should be fed with the single source bone and a list of target bones (can be just one bone in a Bone List of course) and can then be fed with appropriate Eulers, Quaternions, or Vectors, depending on what you want to achieve.
You should note that Source and Target bones must have the same Rotation Mode, i.e. both are Euler, or both are Quaternion, otherwise a miss-match error is reported and your computer will self-destruct, taking you, your computer and any loved ones in the vicinity with it.
Here is a short video made using the Bone nodes (and the Bounce Node):
NOT FINISHED YET 😛