1<html>
2<head>
3<title>Defining Animations</title>
4<link rel="stylesheet" href="../css/mainpage.css" type="text/css">
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6</head>
7
8<body>
9
10<h1>Defining Animations</h1>
11
12<h2>Overview</h2>
13<p>
14This section describes the elements used to define animation for skinning models and the hierarchical structure of scenes. 「As explained in <a href="../cmdl/page_overview_scene.html">Defining a Scene's Hierarchical Structure</a>, all nodes in the intermediate format are defined as bones.  For this reason, the targets of animation are the bones. In this section, we use the term <I>skeletal animation</I> to refer to this animation of bones.
15</p>
16
17<h2>Defining Animation on the <CODE>CMDL</CODE> Side</h2>
18<p>
19The animation data are defined in a <CODE>.cskla</CODE> file, but you also must set definitions for animation on the <CODE>.cmdl</CODE> side for the model data to which the animation data will be applied.  The intermediate format can handle skeletal animation as well as a number of other kinds of animation including material animation and visibility animation. Each kind of animation is called an <I>animation group</I>.
20</p>
21<p>
22The <CODE>&lt;GraphicsAnimationGroupDescription&gt;</CODE> element is defined in order to clearly indicate which animation group(s) to apply to a model.  Contained in this element is information about the animation group type(s), the timing with which the animation(s) will be applied, and the reference to the element(s) inside the <CODE>.cmdl</CODE> file that will be overwritten by the animation(s).
23</p>
24
25<h3>XML Hierarchical Structure</h3>
26<p>
27The <CODE>&lt;AnimationGroupDescriptions&gt;</CODE> element appears only once inside the <CODE>&lt;SkeletalModel&gt;</CODE> element and indicates the start of the definitions of the <CODE>&lt;GraphicsAnimationGroupDescription&gt;</CODE> element(s).  If there are multiple types of animation groups,  then multiple <CODE>&lt;GraphicsAnimationGroupDescription&gt;</CODE> elements are defined.
28</p>
29
30<table>
31<tr><td>
32<pre>
33&lt;NintendoWareIntermediateFile&gt;<br>
34 &lt;GraphicsContentCtr&gt;<br>
35  &lt;Models&gt;<br>
36   &lt;SkeletalModel&gt;<br>
37    &lt;AnimationGroupDescriptions&gt;<br>
38     &lt;GraphicsAnimationGroupDescription&gt;<br>
39       :
40</pre>
41</td></tr>
42</table>
43
44<h2>Actual Definitions on the <CODE>CMDL</CODE> Side</h2>
45<p>
46The <CODE>CMDL</CODE> side would be defined as shown below for skeletal animation. These definitions make it possible to animate all bones of the skeletal model in the <CODE>.cmdl</CODE> file.
47</p>
48
49<table>
50<tr><td>
51<pre>
52&lt;GraphicsAnimationGroupDescription Name=&quot;SkeletalAnimation&quot; EvaluationHint=&quot;BeforeSceneRendering&quot;&gt;<br>
53 &lt;MemberInformationSet&gt;<br>
54  &lt;AnimationMemberDescription BlendOperationName=&quot;CalculatedTransform&quot;&gt;<br>
55   &lt;Path&gt;Skeleton.Bones[&quot;*&quot;].AnimatedTransform&lt;/Path&gt;<br>
56  &lt;/AnimationMemberDescription&gt;<br>
57 &lt;/MemberInformationSet&gt;<br>
58&lt;/GraphicsAnimationGroupDescription&gt;<br>
59</pre>
60</td></tr>
61</table>
62
63<h2>Defining Animation on the <CODE>CSKLA</CODE> Side</h2>
64<p>
65An animation curve is defined for each animation group in the <CODE>.cskla</CODE> file.  Here we describe the process for a skeletal animation. Since bones are the application targets of skeletal animation, the <CODE>&lt;MemberAnimationData&gt;</CODE> element collects together the animation curves for each bone.  This element defines the references to the bones in the <CODE>.cmdl</CODE> file and the actual animation curves.
66</p>
67
68<h3>XML Hierarchical Structure</h3>
69<p>
70The <CODE>&lt;MemberAnimationDataSet&gt;</CODE> element appears only once inside the <CODE>&lt;SkeletalAnimationData&gt;</CODE> element and indicates the start of the definitions of <CODE>&lt;MemberAnimationData&gt;</CODE> element(s).  Multiple <CODE>&lt;MemberAnimationData&gt;</CODE> elements are defined in order to define animation for multiple bones.
71</p>
72
73<table>
74<tr><td>
75<pre>
76&lt;NintendoWareIntermediateFile&gt;<br>
77 &lt;GraphicsContentCtr&gt;<br>
78  &lt;Animations&gt;<br>
79   &lt;SkeletalAnimationData&gt;<br>
80    &lt;MemberAnimationDataSet&gt;<br>
81     &lt;MemberAnimationData&gt;<br>
82       :<br>
83</pre>
84</td></tr>
85</table>
86
87
88<h2>Actual Definitions on the <CODE>CSKLA</CODE> Side</h2>
89<p>
90The <CODE>CSKLA</CODE> side would be defined as shown below for skeletal animation. A <CODE>&lt;MemberAnimationData&gt;</CODE> element is defined for each bone, and the target bone is defined by the  <CODE>&lt;Path&gt;</CODE> element of the child hierarchy.  The next <CODE>&lt;TransformAnimation&gt;</CODE> element defines a translation animation.  The translation animation includes the <CODE>&lt;RotateVector3Animation&gt;</CODE> element representing the rotation, the <CODE>&lt;TranslateVector3Animation&gt;</CODE> element representing the position and the <CODE>&lt;ScaleVector3Animation&gt;</CODE> element representing the scale.  Elements that are not animated are omitted.
91</p>
92
93<table>
94<tr><td>
95<pre>
96&lt;MemberAnimationData&gt;<br>
97 &lt;Path&gt;Skeleton.Bones[&quot;(bone name)&quot;].AnimatedTransform&lt;/Path&gt;<br>
98 &lt;TransformAnimation&gt;<br>
99  &lt;RotateVector3Animation&gt;<br>
100   &lt;XSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;47&quot;&gt;<br>
101    &lt;Segments&gt;<br>
102     &lt;HermiteFloatSegment&gt;<br>
103      &lt;Keys&gt;<br>
104       &lt;HermiteFloatKey Frame=&quot;0&quot; Value=&quot;0.00889709&quot; InSlope=&quot;0.0220294&quot; OutSlope=&quot;0.0220294&quot; /&gt;<br>
105         :<br>
106      &lt;/Keys&gt;<br>
107     &lt;/HermiteFloatSegment&gt;<br>
108    &lt;/Segments&gt;<br>
109   &lt;/XSegmentsFloatCurve&gt;<br>
110   &lt;YSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;47&quot;&gt;<br>
111     :<br>
112   &lt;/YSegmentsFloatCurve&gt;<br>
113   &lt;ZSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;47&quot;&gt;<br>
114     :<br>
115   &lt;/ZSegmentsFloatCurve&gt;<br>
116  &lt;/RotateVector3Animation&gt;<br>
117  &lt;TranslateVector3Animation&gt;<br>
118    :<br>
119  &lt;/TranslateVector3Animation&gt;<br>
120 &lt;/TransformAnimation&gt;<br>
121&lt;/MemberAnimationData&gt;<br>
122</pre>
123</td></tr>
124</table>
125
126<hr><p>CONFIDENTIAL</p></body>
127</html>
128