Defining Material Animation
Overview
This 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.
Defining Animation on the CMDL
Side
The animation data are defined in a .mata
file, but you also must set definitions for animation on the .cmdl
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 animation group. The <GraphicsAnimationGroupDescription>
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 .cmdl
file that will be overwritten by the animation(s).
XML Hierarchical Structure
The <AnimationGroupDescriptions>
element appears only once inside the <SkeletalModel>
element and indicates the start of the definitions of the <GraphicsAnimationGroupDescription>
element(s). If there are multiple types of animation groups, then multiple <GraphicsAnimationGroupDescription>
elements are defined.
<NintendoWareIntermediateFile>
<GraphicsContentCtr>
<Models>
<SkeletalModel>
<AnimationGroupDescriptions>
<GraphicsAnimationGroupDescription>
|
Actual Definitions on the CMDL
Side
The CMDL side is defined as shown below for material animation. These definitions make it possible to animate all materials in the .cmdl
file.
<GraphicsAnimationGroupDescription Name="MaterialAnimation" EvaluationTiming="AfterSceneCulling">
<MemberInformationSet>
<AnimationMemberDescription BlendOperationName="CalculatedTransform">
<AnimationMemberDescription BlendOperationName="RgbaColor">
<Path>Materials["*"].MaterialColor.Emission</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="RgbaColor">
<Path>Materials["*"].MaterialColor.Ambient</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="RgbaColor">
<Path>Materials["*"].MaterialColor.Diffuse</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="RgbaColor">
<Path>Materials["*"].MaterialColor.Specular0</Path>
</AnimationMemberDescription>
.... omitted .....
<AnimationMemberDescription BlendOperationName="Int">
<Path>Materials["*"].TextureMappers["*"].Texture</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="RgbaColor">
<Path>Materials["*"].FragmentOperation.BlendOperation.BlendColor</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="Vector2">
<Path>Materials["*"].TextureCoordinators["*"].Scale</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="Float">
<Path>Materials["*"].TextureCoordinators["*"].Rotate</Path>
</AnimationMemberDescription>
<AnimationMemberDescription BlendOperationName="Vector2">
<Path>Materials["*"].TextureCoordinators["*"].Translate</Path>
</AnimationMemberDescription>
</AnimationMemberDescription>
</MemberInformationSet>
</GraphicsAnimationGroupDescription>
|
Defining Texture Patterns on the CMATA Side
Texture pattern animation is defined as an enumerated list of references to textures and the animation of that index. Multiple <TexturePattern>
can be defined in the <TexturePatterns>
element.
XML Hierarchical Structure
<NintendoWareIntermediateFile>
<GraphicsContentCtr>
<Animations>
<MaterialAnimationData>
<MemberAnimationDataSet>
<MemberAnimationData>
|
Actual Definitions on the CMATA Side
The CMATA side is defined as shown below for material animation. Separate <MemberAnimationData>
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 <Path>
element.
Animations are defined for colors by <RgbaColorAnimation>
elements.
Animations are defined for the Translate and Scale of the UV coordinates by <Vector2Animation>
elements.
Animation is defined for the Rotate of the UV coordinates by the <FloatAnimation>
element.
Animations are defined for texture patterns by <IntAnimation>
elements.
Elements that are not animated are omitted.
<MemberAnimationDataSet>
<!-- Animation of colors-->
<MemberAnimationData>
<Path>Materials[(material name)].MaterialColor.Emission</Path>
<RgbaColorAnimation>
<RSegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="60">
<Segments>
<HermiteFloatSegment>
<Keys>
<HermiteFloatKey Frame="0" Value="0" InSlope="0.000824074" OutSlope="0.000824074" />
:
</Keys>
</HermiteFloatSegment>
</Segments>
</RSegmentsFloatCurve>
</RgbaColorAnimation>
</MemberAnimationData>
<!--Animation of UV coordinates-->
<MemberAnimationData>
<Path>Materials[(material name)].TextureCoordinators[0].Translate</Path>
<Vector2Animation>
<XSegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="50">
<Segments>
<HermiteFloatSegment>
<Keys>
<HermiteFloatKey Frame="0" Value="0" InSlope="0.00162963" OutSlope="0.00162963" />
:
</Keys>
</HermiteFloatSegment>
</Segments>
</XSegmentsFloatCurve>
</Vector2Animation>
</MemberAnimationData>
<!--Animation of texture patterns-->
<MemberAnimationData>
<Path>Materials[(material name)].TextureMappers[0].Texture</Path>
<IntAnimation>
<SegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="5">
<Segments>
<StepFloatSegment>
<Keys>
<StepFloatKey Frame="0" Value="0" />
:
</Keys>
</StepFloatSegment>
</Segments>
</SegmentsFloatCurve>
</IntAnimation>
</MemberAnimationData>
</MemberAnimationDataSet>
|
CONFIDENTIAL