Animation SDL
 
 
 

Platforms

Windows

Description

An Animation SDL file is a regular Scene Description Language file with an extra section to describe the model’s hierarchies. An Animation SDL file has two sections, DEFINITION and HIERARCHY.

Note

The HIERARCHY section may be omitted. In this case, the Animation SDL file contains only 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.

Example 1

HIERARCHY  
{    <----- Picked object 
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 as a place-holder 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, specify an empty pair of braces as a place-holder 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.

Specifying the type of object

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, and Curve CV.

If the curve is part of a face, two values are specified separated by a comma. The first value specifies the curve of the face, and the second value specifies the CV on the curve. For example, if a face is made up of 3 curves, then to refer to the 4th CV on the 2nd curve of the face, the type statement is written as:

type “Curve CV” (2, 4);

Applying the animation

The statements following the type statements indicate how animation is applied to each of the item’s animation parameters. These are called channel statements, and specify how the animation parameter uses the actions from the DEFINITION section.

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 > Editors > 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

Do not assign a channel to an item that does not animate in that parameter. Also, do not assign a channel that is not part of the current animation item type. For example, Animation SDL does not differentiate between types of lights, so it is possible to try to read a Spot spread channel onto a point light, but that results 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 that are within additional parentheses act as timewarps on the original curve.

Example 2

The following is an example Animation SDL file of an animated cylinder.

DEFINITION 	/* the 3-D NURBS curve used by the motion path action */ 	
												curve curve#2 (
																	 		degree = 3, 		
																				knots = (0.0, 0.0, 0.0, 1.0, 1.0 , 1.0 ), 		
																				cvs = ( 			
																												cv( (0.0, 0.0, 0.0),1.0), 			
																												cv( (3.0, 3.0, 3.0),1.0), 			
																												cv( (-4.0, 2.0, -6.0),1.0), 			
																												cv( (-3.0, 2.0, 3.0),1.0) ) 	
												); 	
												/* a motion path action */ 	
												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)) 	
												) );  

HIERARCHY 	
								{ 		
												type "Dag Node" ( cylinder );  		

												/* 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.       */ 		
												type "Dag Node" ( cyl_body ); 		
												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*/ 		
												/* hierarchy structure.                     */ 		
												/* 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 */ 		
												/* is.                                      */ 		
												{ 			
																			type "Surface CV" ( 2, 4 ); 			
																			/* 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 
); 	
							} 
}