mayaAnimation
The mayaAnimation node can load animation files created in Maya, and use them to animate objects in YG. Currently this node only supports animation of transforms (position, orientation, and scale). You can use it to animate motion of objects, but not deformation. For example, you could use it to create a segmented, animated character, but not a smooth-skinned one.
Node Syntax
mayaAnimation (file("anim file"),start(clipnumber))
{
object (file("model file"))
}
Animating a Bird in Maya
- create one poly object for the bird's body. name it "body".
- create another poly object for the right wing. name it "right_wing".
- create the left wing as a mirror image of the right wing, and name it "left_wing".
- note - if you do this by duplicating and scaling X -1, you should flatten the transform on the left wing. Negative-scaled objects won't show up.
- set the pivot points of each wing to the base of the wing
- position the wings on the bird, and parent them to the bird.
- set a keyframe for the wings in an 'up' position at frame 0
- set a keyframe in a down position at frame 15
- set a keyframe in the up position at frame 30
- Note:you MUST have at least one keyframe (usually on frame 1) for all the channels in the channel box; otherwise the maya animation plugin will crash.
Exporting the model file
Select the bird and both wings. Export Selection as a .B3D file. Set the Hierarchy to Full. Export it as "bird.b3d".Exporting the .anim file
Select the bird and both wings. Export Selection as a .anim file. Export it as "bird.anim".
Set up the YG Scene
mayaAnimation (file("bird.anim"),start(1))
{
object (file("bird.b3d"))
}
Make the animation loop
The wings just flap once and then stop. To make them loop, change the post-infinity setting in Maya.- in Maya, select the wings.
- open the Graph Editor
- go to Curves->Post Infinity->Cycle. This will make the animation loop after the last keyframe.
- Select the bird and the wings.
- Export Selection as a .anim file again. Set the Time Range to "All".
- you don't need to export the .b3d file again, or change anything in the YG scene file.

(click to enlarge)
Animate the bird's flight
- in Maya, select the bird's body
- move the bird around and set keyframes
- if you want to loop this animation too, set its post-infinity to Cycle.
- export the .anim file again.
Using Multiple Clips
the mayaAnimation node can load multiple .anim files as different clips, so one object can switch between different motions.
mayaAnimation birdanimation (
file("flight_1.anim"),file("flight_2.anim"),file("flight_3.anim")
)
{
object (file("bird.b3d"))
}
wandTrigger (
when(button1,birdanimation.start(1)),
when(button2,birdanimation.start(2)),
when(button3,birdanimation.start(3))
)
(c) Ben Chang