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><GraphicsAnimationGroupDescription></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><AnimationGroupDescriptions></CODE> element appears only once inside the <CODE><SkeletalModel></CODE> element and indicates the start of the definitions of the <CODE><GraphicsAnimationGroupDescription></CODE> element(s). If there are multiple types of animation groups, then multiple <CODE><GraphicsAnimationGroupDescription></CODE> elements are defined. 28</p> 29 30<table> 31<tr><td> 32<pre> 33<NintendoWareIntermediateFile><br> 34 <GraphicsContentCtr><br> 35 <Models><br> 36 <SkeletalModel><br> 37 <AnimationGroupDescriptions><br> 38 <GraphicsAnimationGroupDescription><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<GraphicsAnimationGroupDescription Name="SkeletalAnimation" EvaluationHint="BeforeSceneRendering"><br> 53 <MemberInformationSet><br> 54 <AnimationMemberDescription BlendOperationName="CalculatedTransform"><br> 55 <Path>Skeleton.Bones["*"].AnimatedTransform</Path><br> 56 </AnimationMemberDescription><br> 57 </MemberInformationSet><br> 58</GraphicsAnimationGroupDescription><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><MemberAnimationData></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><MemberAnimationDataSet></CODE> element appears only once inside the <CODE><SkeletalAnimationData></CODE> element and indicates the start of the definitions of <CODE><MemberAnimationData></CODE> element(s). Multiple <CODE><MemberAnimationData></CODE> elements are defined in order to define animation for multiple bones. 71</p> 72 73<table> 74<tr><td> 75<pre> 76<NintendoWareIntermediateFile><br> 77 <GraphicsContentCtr><br> 78 <Animations><br> 79 <SkeletalAnimationData><br> 80 <MemberAnimationDataSet><br> 81 <MemberAnimationData><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><MemberAnimationData></CODE> element is defined for each bone, and the target bone is defined by the <CODE><Path></CODE> element of the child hierarchy. The next <CODE><TransformAnimation></CODE> element defines a translation animation. The translation animation includes the <CODE><RotateVector3Animation></CODE> element representing the rotation, the <CODE><TranslateVector3Animation></CODE> element representing the position and the <CODE><ScaleVector3Animation></CODE> element representing the scale. Elements that are not animated are omitted. 91</p> 92 93<table> 94<tr><td> 95<pre> 96<MemberAnimationData><br> 97 <Path>Skeleton.Bones["(bone name)"].AnimatedTransform</Path><br> 98 <TransformAnimation><br> 99 <RotateVector3Animation><br> 100 <XSegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="47"><br> 101 <Segments><br> 102 <HermiteFloatSegment><br> 103 <Keys><br> 104 <HermiteFloatKey Frame="0" Value="0.00889709" InSlope="0.0220294" OutSlope="0.0220294" /><br> 105 :<br> 106 </Keys><br> 107 </HermiteFloatSegment><br> 108 </Segments><br> 109 </XSegmentsFloatCurve><br> 110 <YSegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="47"><br> 111 :<br> 112 </YSegmentsFloatCurve><br> 113 <ZSegmentsFloatCurve PreRepeatMethod="None" PostRepeatMethod="None" StartFrame="0" EndFrame="47"><br> 114 :<br> 115 </ZSegmentsFloatCurve><br> 116 </RotateVector3Animation><br> 117 <TranslateVector3Animation><br> 118 :<br> 119 </TranslateVector3Animation><br> 120 </TransformAnimation><br> 121</MemberAnimationData><br> 122</pre> 123</td></tr> 124</table> 125 126<hr><p>CONFIDENTIAL</p></body> 127</html> 128