An Animation SDL file is similar to, but distinct
from, a regular SDL file (see File
Save SDL). An Animation SDL file consists of two sections,
the DEFINITION section and the HIERARCHY section.
Note: The HIERARCHY section may be omitted. In this case, the Animation SDL file just contains a library of animation curves (or actions).
In the DEFINITION section, you specify the description of the curves (or actions) as you do in regular SDL. The syntax for actions is the same for Animation SDL and regular SDL.
In the HIERARCHY section, you describe how the animation curves in the DEFINITION section are applied to the model's hierarchy. The braces, { } bracket these descriptions. You must supply at least one set of braces. The order of the braces describes the hierarchy. Matching pairs of braces inside another matching pair indicates that the inner pair refers to an object that is a child of the outer pair's object. Matching pairs that follow one another indicate that the pairs are children of the same parent. See the following example.
Apply animation to picked object.
{ <----- A child of the picked object.
Apply animation to child of picked object.
{ <----- A child of a child of the picked object.
Apply animation to child of a child of picked object.
{ <----- Another child of the picked object.
Apply animation to other child picked object.
If an object has no animation, but a descendant does, you must still specify the braces for the object, but omit the statements applying any animation to it. This is also necessary for siblings. If the leftmost sibling is unanimated, but the one to its right is animated, you must specify an empty pair of braces as a placeholder for the leftmost child.
There are two statements in the HIERARCHY section that apply animation to objects. The first is the type statement, which indicates the type of object that will receive the animation.
The general form of the type statement is:
type "animatable item type name" ( <additional information> ); Examples of the "animatable item type name" are Dag Node, Camera, Light, Shader, Surface CV, Curve CV, and Polyset Vertex.
The general form of the channel statement is:
channel "channel name" (action_name
[extract axis] (action_name...)); Each animatable
item type has its own set of animation parameter names, which can be seen
in the param control window (see Animation
Param control for details). For example, Dag Nodes have
X Translate, Y Translate, Z Scale, and Visibility. These names, which appear
in the param control window, can be used as channel name.
Note: It is an error to try to assign a channel to an item that does not animate in that parameter. It is also an error to assign a channel that is not part of the current animation item type. For example, Animation SDL does not differentiate between different types of lights, so it is possible to try to read a Spot spread channel onto a point light, but this will result in an error.
Within the parentheses of the channel statement, you
specify the list of actions that make up the channel. If the action is
a motion path, you must specify which axis of the 3D NURBS curve to use.
Additional actions contained within additional parentheses act as timewarps
on the original curve (see Anim
Time Warps
New time warp).
The following is a commented example Animation SDL file of an animated cylinder.
/* the 3-D NURBS curve used by the motion path action */
knots = (0.0, 0.0, 0.0, 1.0, 1.0 , 1.0 ),
motion_curve motion_path ( curve#2, in = PRE_CONSTANT, out = POST_CONSTANT );
/* several parameter curve actions */
parameter_curve param_curve.Timing ( in = PRE_LINEAR, out = POST_LINEAR, cvs = (
parameter_vertex(1.0,0.0 , TAN_SMOOTH, ( -0.27852, -0.96043 ), TAN_SMOOTH, (0.27852,0.96043) ),
parameter_vertex(30.0,30.0, TAN_SMOOTH, (-0.27852,-0.96043 ), TAN_SMOOTH, (0.27852,0.96043) )
parameter_curve param_curve.X_Scale ( in = PRE_CONSTANT, out = POST_CONSTANT, cvs = (
parameter_vertex(1.0 , 1.0 , TAN_SMOOTH, (1.0 ,0.0), TAN_SMOOTH, (1.0 , 0.0) ),
parameter_vertex( 30.0 , 4.0 , TAN_SMOOTH, (1.0 ,0.0), TAN_SMOOTH, (1.0 , 0.0) )
parameter_curve param_curve.Z_Rotate ( in = PRE_CONSTANT, out = POST_CONSTANT, cvs = (
parameter_vertex(1.0 , 0.0, TAN_SMOOTH, (-1.0 , 0.0), TAN_SMOOTH, (1.0 , 0.0) ),
parameter_vertex(30.0 ,360.0 , TAN_SMOOTH, (-1.0 , 0.0 ), TAN_SMOOTH, (1.0, 0.0) )
parameter_curve timewarp ( in = PRE_IDENTITY, out = POST_IDENTITY, cvs = (
parameter_vertex(1.0 , 1.0, TAN_SMOOTH, (-0.70711,-0.70711 ), TAN_SMOOTH, (0.70711,0.70711) ),
parameter_vertex(30.0 ,30.0 ,TAN_SMOOTH, (-0.70711,-0.70711 ),TAN_SMOOTH, (0.70711,0.70711) )
parameter_curve param_curve.X_Position ( in = PRE_CONSTANT, out = POST_CONSTANT, cvs = (
parameter_vertex(1.0 , -0.2612 , TAN_SMOOTH, (-1.0 ,0.0), TAN_SMOOTH, (-1.0 ,0.0) ),
parameter_vertex( 30.0 , -0.18593, TAN_SMOOTH, (-1.0 ,0.0), TAN_SMOOTH, (-1.0 ,0.0) )
parameter_curve param_curve.Y_Position ( in = PRE_CONSTANT, out = POST_CONSTANT, cvs = (
parameter_vertex(1.0 ,0.2612 , TAN_SMOOTH, (-1.0 ,0.0 ), TAN_SMOOTH, (-1.0 ,0.0) ),
parameter_vertex( 30.0 , 0.58722, TAN_SMOOTH, ( -1.0 , 0.0 ), TAN_SMOOTH, (-1.0 ,0.0))
parameter_curve param_curve.Z_Position ( in = PRE_CONSTANT, out = POST_CONSTANT, cvs = (
parameter_vertex( 1.0 , 0.5 , TAN_SMOOTH, ( -1.0 , 0.0 ), TAN_SMOOTH, ( 1.0 , 0.0 ) ),
parameter_vertex( 30.0, 0.90137, TAN_SMOOTH, ( -1.0 , 0.0 ), TAN_SMOOTH, (-1.0 ,0.0))
/* The cylinder is moved along a motion path. */
/* Each channel is extracted from a motion path */
/* with one timing curve modifying all three. */
channel "X Translate" ( motion_path [X] ( param_curve.Timing ));
channel "Y Translate" ( motion_path [Y] ( param_curve.Timing ));
channel "Z Translate" ( motion_path [Z] ( param_curve.Timing ));
/* The width of the cylinder is also animated. */
channel "X Scale" ( param_curve.X_Scale );
/* This is the first child of the top level */
/* of the cylinder. It spins around the Z */
/* axis. A timewarp has been applied. */
channel "Z Rotate" ( param_curve.Z_Rotate ( timewarp ));
/* Cap A of the cylinder is not animated, */
/* nor are any of its CVs, but these braces */
/* are necessary to maintain to maintain the*/
/* If these braces were omitted Cap B's */
/* animation would be read onto Cap A. */
/* Cap B is not animated but one of its cvs */
/* Surface CV u = 2, v = 4 is animated. */
channel "X Position" ( param_curve.X_Position );
channel "Y Position" ( param_curve.Y_Position );
channel "Z Position" ( param_curve.Z_Position );
Copyright © 1998, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.