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. 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.
109</p>
110<li>
111<ul>Animations are defined for colors by <CODE>&lt;RgbaColorAnimation&gt;</CODE> elements.</ul>
112<ul>Animations are defined for the Translate and Scale of the UV coordinates by <CODE>&lt;Vector2Animation&gt;</CODE> elements.</ul>
113<ul>Animation is defined for the Rotate of the UV coordinates by the <CODE>&lt;FloatAnimation&gt;</CODE> element.</ul>
114<ul>Animations are defined for texture patterns by <CODE>&lt;IntAnimation&gt;</CODE> elements.</ul>
115<p>
116Elements that are not animated are omitted.
117</p>
118
119<table>
120<tr><td>
121<pre>
122&lt;MemberAnimationDataSet&gt;<br>
123<br>
124 &lt;!-- Animation of colors--&gt;<br>
125 &lt;MemberAnimationData&gt;<br>
126  &lt;Path&gt;Materials[(material name)].MaterialColor.Emission&lt;/Path&gt;<br>
127  &lt;RgbaColorAnimation&gt;<br>
128   &lt;RSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;60&quot;&gt;<br>
129    &lt;Segments&gt;<br>
130     &lt;HermiteFloatSegment&gt;<br>
131      &lt;Keys&gt;<br>
132       &lt;HermiteFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; InSlope=&quot;0.000824074&quot; OutSlope=&quot;0.000824074&quot; /&gt;<br>
133       :<br>
134      &lt;/Keys&gt;<br>
135     &lt;/HermiteFloatSegment&gt;<br>
136    &lt;/Segments&gt;<br>
137   &lt;/RSegmentsFloatCurve&gt;<br>
138  &lt;/RgbaColorAnimation&gt;<br>
139 &lt;/MemberAnimationData&gt;<br>
140<br>
141 &lt;!--Animation of UV coordinates--&gt;<br>
142 &lt;MemberAnimationData&gt;<br>
143  &lt;Path&gt;Materials[(material name)].TextureCoordinators[0].Translate&lt;/Path&gt;<br>
144  &lt;Vector2Animation&gt;<br>
145   &lt;XSegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;50&quot;&gt;<br>
146    &lt;Segments&gt;<br>
147     &lt;HermiteFloatSegment&gt;<br>
148      &lt;Keys&gt;<br>
149       &lt;HermiteFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; InSlope=&quot;0.00162963&quot; OutSlope=&quot;0.00162963&quot; /&gt;<br>
150       :<br>
151      &lt;/Keys&gt;<br>
152     &lt;/HermiteFloatSegment&gt;<br>
153    &lt;/Segments&gt;<br>
154   &lt;/XSegmentsFloatCurve&gt;<br>
155  &lt;/Vector2Animation&gt;<br>
156 &lt;/MemberAnimationData&gt;<br>
157<br>
158 &lt;!--Animation of texture patterns--&gt;<br>
159 &lt;MemberAnimationData&gt;<br>
160  &lt;Path&gt;Materials[(material name)].TextureMappers[0].Texture&lt;/Path&gt;<br>
161  &lt;IntAnimation&gt;<br>
162   &lt;SegmentsFloatCurve PreRepeatMethod=&quot;None&quot; PostRepeatMethod=&quot;None&quot; StartFrame=&quot;0&quot; EndFrame=&quot;5&quot;&gt;<br>
163    &lt;Segments&gt;<br>
164     &lt;StepFloatSegment&gt;<br>
165      &lt;Keys&gt;<br>
166       &lt;StepFloatKey Frame=&quot;0&quot; Value=&quot;0&quot; /&gt;<br>
167       :<br>
168      &lt;/Keys&gt;<br>
169     &lt;/StepFloatSegment&gt;<br>
170    &lt;/Segments&gt;<br>
171   &lt;/SegmentsFloatCurve&gt;<br>
172  &lt;/IntAnimation&gt;<br>
173 &lt;/MemberAnimationData&gt;<br>
174<br>
175&lt;/MemberAnimationDataSet&gt;<br>
176</pre>
177</td></tr>
178</table>
179
180<hr><p>CONFIDENTIAL</p></body>
181</html>
182