1<html>
2<head>
3<title>Defining Material Animation</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 Material Animation</h1>
11
12<h2>Overview</h2>
13<p>
14This page describes the elements used to define animations to materials. The animation targets are the material's colors, the SRT of the UV coordinates, and the texture patterns.
15</p>
16
17<h2>Defining Animation on the <CODE>CMDL</CODE> Side</h2>
18<p>
19The animation data are defined in a <CODE>.mata</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>. The <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).
20</p>
21
22<h3>XML Hierarchical Structure</h3>
23<p>
24The <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.
25</p>
26<table>
27<tr><td>
28<pre>
29&lt;NintendoWareIntermediateFile&gt;<br>
30  &lt;GraphicsContentCtr&gt;<br>
31    &lt;Models&gt;<br>
32      &lt;SkeletalModel&gt;<br>
33        &lt;AnimationGroupDescriptions&gt;<br>
34          &lt;GraphicsAnimationGroupDescription&gt;<br>
35</pre>
36</td></tr>
37</table>
38
39<h2>Actual Definitions on the <CODE>CMDL</CODE> Side</h2>
40<p>
41The CMDL side is defined as shown below for material animation. These definitions make it possible to animate all materials in the <CODE>.cmdl</CODE> file.
42</p>
43
44<table>
45<tr><td>
46<pre>
47&lt;GraphicsAnimationGroupDescription Name=&quot;MaterialAnimation&quot; EvaluationTiming=&quot;AfterSceneCulling&quot;&gt;<br>
48  &lt;MemberInformationSet&gt;<br>
49    &lt;AnimationMemberDescription BlendOperationName=&quot;CalculatedTransform&quot;&gt;<br>
50      &lt;AnimationMemberDescription BlendOperationName=&quot;RgbaColor&quot;&gt;<br>
51        &lt;Path&gt;Materials[&quot;*&quot;].MaterialColor.Emission&lt;/Path&gt;<br>
52      &lt;/AnimationMemberDescription&gt;<br>
53      &lt;AnimationMemberDescription BlendOperationName=&quot;RgbaColor&quot;&gt;<br>
54        &lt;Path&gt;Materials[&quot;*&quot;].MaterialColor.Ambient&lt;/Path&gt;<br>
55      &lt;/AnimationMemberDescription&gt;<br>
56      &lt;AnimationMemberDescription BlendOperationName=&quot;RgbaColor&quot;&gt;<br>
57        &lt;Path&gt;Materials[&quot;*&quot;].MaterialColor.Diffuse&lt;/Path&gt;<br>
58      &lt;/AnimationMemberDescription&gt;<br>
59      &lt;AnimationMemberDescription BlendOperationName=&quot;RgbaColor&quot;&gt;<br>
60        &lt;Path&gt;Materials[&quot;*&quot;].MaterialColor.Specular0&lt;/Path&gt;<br>
61      &lt;/AnimationMemberDescription&gt;<br>
62<br>
63	  .... omitted .....<br>
64<br>
65      &lt;AnimationMemberDescription BlendOperationName=&quot;Int&quot;&gt;<br>
66        &lt;Path&gt;Materials[&quot;*&quot;].TextureMappers[&quot;*&quot;].Texture&lt;/Path&gt;<br>
67      &lt;/AnimationMemberDescription&gt;<br>
68      &lt;AnimationMemberDescription BlendOperationName=&quot;RgbaColor&quot;&gt;<br>
69        &lt;Path&gt;Materials[&quot;*&quot;].FragmentOperation.BlendOperation.BlendColor&lt;/Path&gt;<br>
70      &lt;/AnimationMemberDescription&gt;<br>
71      &lt;AnimationMemberDescription BlendOperationName=&quot;Vector2&quot;&gt;<br>
72        &lt;Path&gt;Materials[&quot;*&quot;].TextureCoordinators[&quot;*&quot;].Scale&lt;/Path&gt;<br>
73      &lt;/AnimationMemberDescription&gt;<br>
74      &lt;AnimationMemberDescription BlendOperationName=&quot;Float&quot;&gt;<br>
75        &lt;Path&gt;Materials[&quot;*&quot;].TextureCoordinators[&quot;*&quot;].Rotate&lt;/Path&gt;<br>
76      &lt;/AnimationMemberDescription&gt;<br>
77      &lt;AnimationMemberDescription BlendOperationName=&quot;Vector2&quot;&gt;<br>
78        &lt;Path&gt;Materials[&quot;*&quot;].TextureCoordinators[&quot;*&quot;].Translate&lt;/Path&gt;<br>
79      &lt;/AnimationMemberDescription&gt;<br>
80    &lt;/AnimationMemberDescription&gt;<br>
81  &lt;/MemberInformationSet&gt;<br>
82&lt;/GraphicsAnimationGroupDescription&gt;<br>
83</pre>
84</td></tr>
85</table>
86
87<h2>Defining Texture Patterns on the CMATA Side</h2>
88<p>
89Texture pattern animation is defined as an enumerated list of references to textures and the animation of that index. Multiple <CODE>&lt;TexturePattern&gt;</CODE> can be defined in the <CODE>&lt;TexturePatterns&gt;</CODE> element.
90</p>
91
92<h3>XML Hierarchical Structure</h3>
93<table>
94<tr><td>
95<pre>
96&lt;NintendoWareIntermediateFile&gt;<br>
97  &lt;GraphicsContentCtr&gt;<br>
98    &lt;Animations&gt;<br>
99      &lt;MaterialAnimationData&gt;<br>
100        &lt;MemberAnimationDataSet&gt;<br>
101          &lt;MemberAnimationData&gt;<br>
102</pre>
103</td></tr>
104</table>
105
106<h2>Actual Definitions on the CMATA Side</h2>
107<p>
108The CMATA side is defined as shown below for material animation.
109
110<ul>
111<li>Separate <CODE>&lt;MemberAnimationData&gt;</CODE> are defined for each color, for the Translate, Scale and Rotate of the UV coordinates,  and for the texture patterns, and the target bones are specified by the child hierarchy's <CODE>&lt;Path&gt;</CODE> element.</li>
112<li>Animations are defined for colors by <CODE>&lt;RgbaColorAnimation&gt;</CODE> elements.</li>
113<li>Animations are defined for the Translate and Scale of the UV coordinates by <CODE>&lt;Vector2Animation&gt;</CODE> elements.</li>
114<li>Animation is defined for the Rotate of the UV coordinates by the <CODE>&lt;FloatAnimation&gt;</CODE> element.</li>
115<li>Animations are defined for texture patterns by <CODE>&lt;IntAnimation&gt;</CODE> elements.</li>
116<li>Elements that are not animated are omitted.</li>
117</ul>
118</p>
119
120<table>
121<tr><td>
122<pre>
123&lt;MemberAnimationDataSet&gt;<br>
124<br>
125 &lt;!-- Animation of colors--&gt;<br>
126 &lt;MemberAnimationData&gt;<br>
127  &lt;Path&gt;Materials[(material name)].MaterialColor.Emission&lt;/Path&gt;<br>
128  &lt;RgbaColorAnimation&gt;<br>
129   &lt;RSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;60&quot;&gt;<br>
130    &lt;Segments&gt;<br>
131     &lt;HermiteFloatSegment&gt;<br>
132      &lt;Keys&gt;<br>
133       &lt;HermiteFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; InSlope=&quot;0.000824074&quot; OutSlope=&quot;0.000824074&quot; /&gt;<br>
134       :<br>
135      &lt;/Keys&gt;<br>
136     &lt;/HermiteFloatSegment&gt;<br>
137    &lt;/Segments&gt;<br>
138   &lt;/RSegmentsFloatCurve&gt;<br>
139  &lt;/RgbaColorAnimation&gt;<br>
140 &lt;/MemberAnimationData&gt;<br>
141<br>
142 &lt;!-- Texture SRT Animation --&gt;<br>
143 &lt;MemberAnimationData&gt;<br>
144  &lt;Path&gt;Materials[(material name)].TextureCoordinators[0].Translate&lt;/Path&gt;<br>
145  &lt;Vector2Animation&gt;<br>
146   &lt;XSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;50&quot;&gt;<br>
147    &lt;Segments&gt;<br>
148     &lt;HermiteFloatSegment&gt;<br>
149      &lt;Keys&gt;<br>
150       &lt;HermiteFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; InSlope=&quot;0.00162963&quot; OutSlope=&quot;0.00162963&quot; /&gt;<br>
151       :<br>
152      &lt;/Keys&gt;<br>
153     &lt;/HermiteFloatSegment&gt;<br>
154    &lt;/Segments&gt;<br>
155   &lt;/XSegmentsFloatCurve&gt;<br>
156  &lt;/Vector2Animation&gt;<br>
157 &lt;/MemberAnimationData&gt;<br>
158<br>
159 &lt;!--Animation of texture patterns--&gt;<br>
160 &lt;MemberAnimationData&gt;<br>
161  &lt;Path&gt;Materials[(material name)].TextureMappers[0].Texture&lt;/Path&gt;<br>
162  &lt;IntAnimation&gt;<br>
163   &lt;SegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;5&quot;&gt;<br>
164    &lt;Segments&gt;<br>
165     &lt;StepFloatSegment&gt;<br>
166      &lt;Keys&gt;<br>
167       &lt;StepFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; /&gt;<br>
168       :<br>
169      &lt;/Keys&gt;<br>
170     &lt;/StepFloatSegment&gt;<br>
171    &lt;/Segments&gt;<br>
172   &lt;/SegmentsFloatCurve&gt;<br>
173  &lt;/IntAnimation&gt;<br>
174 &lt;/MemberAnimationData&gt;<br>
175<br>
176&lt;/MemberAnimationDataSet&gt;<br>
177</pre>
178</td></tr>
179</table>
180
181<hr><p>CONFIDENTIAL</p></body>
182</html>
183