Windows
アニメーション SDL ファイルは、モデルの階層を示す特別なセクションを含む、標準的なシーン記述言語ファイルです。アニメーション SDL ファイルには、DEFINITION と HIERARCHY の 2 つのセクションがあります。
HIERARCHY セクションは省略されることもあります。この場合には、アニメーション SDL ファイルはアニメーション カーブ(またはアクション)のライブラリのみが含まれます。
DEFINITION セクションでは、通常の SDL のようにカーブ(またはアクション)を指定します。アクションに使用する構文はアニメーション SDL や通常の SDL に使用する構文と同じです。
HIERARCHY セクションでは、DEFINITION セクションのアニメーション カーブがモデルの階層にどのように適用されるかを記述します。
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. } }
特定のオブジェクト自身にはアニメーションがないがその子や孫にアニメーションがある場合はそのオブジェクトもプレースホルダとして中括弧でくくる必要がありますが、そのオブジェクトにアニメーションを適用するステートメントは削除する必要があります。これは、兄弟関係にあるオブジェクトについても必要です。一番左の兄弟はアニメーション化しないがその右の兄弟はアニメーション化する場合は、一番左の子用のプレースホルダとして 1 対の空の中括弧を指定する必要があります。
HIERARCHY セクションには、オブジェクトにアニメーションを適用するステートメントが 2 つあります。1 つは type ステートメントで、アニメーションを受け取るオブジェクトの種類を指定します。
type ステートメントの一般的な形式は次のとおりです。
type “animatable item type name” ( <additional information> );
「アニメーション化可能なアイテムの種類」には、Dag Node、Camera、Light、Shader、Surface CV、Curve CV などがあります。
カーブがフェースの一部である場合は、2 つの値を 1 つのカンマで区切って指定します。1 番目の値はフェースのカーブを、2 番目の値はカーブの CV を指定するものです。たとえば、フェースが 3 つのカーブで構成される場合、フェースの 2 番目のカーブ上の 4 番目の CV を参照するときの type ステートメントは次のようになります。
type “Curve CV” (2, 4);
type ステートメントに続くステートメントは、各項目のアニメーション パラメータにアニメーションをどのように適用するかを示します。これらはチャンネル ステートメントと呼ばれ、アニメーション パラメータが DEFINITION セクションからのアクションを使用する方法を指定します。
channel ステートメントの一般的な形式は次のとおりです。
channel “channel name” (action_name [extract axis] (action_name...));
アニメーション化可能な項目には、種類ごとにアニメーション パラメータ名の集合があります。この集合は、Parameter Control ウィンドウに表示されます(詳細については、「Animation > Editors > Param Control」を参照してください)。たとえば、DAG Nodes には X Translate、Y Translate、Z Scale、Visibility があります。この名前は Parameter Control ウィンドウに表示され、channel name として使用することができます。
そのパラメータでアニメーション化されていない項目にはチャンネルを割り当てないでください。また、現在のアニメーション アイテムの種類の一部ではないチャンネルを割り当てないでください。たとえば、アニメーション SDL はライトの種類を区別しないため、スポット スプレッド チャンネルをポイント ライト(点光源)上に読み込む操作はできますが、エラーになります。
channel ステートメントの丸括弧の中には、チャンネルを構成するアクションのリストを指定します。アクションがモーション パスの場合は、使用する 3D NURBS カーブの軸を指定する必要があります。追加の丸括弧の中で指定する追加アクションは、オリジナル カーブ上で Time Warp の働きをします。
次に示すのはアニメーション化された円柱のアニメーション SDL ファイルの例です。
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 ); } }