Results 1 to 2 of 2

Thread: Help with <animation> <channel> XYZ ANGLE target

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Help with <animation> <channel> XYZ ANGLE target

    I have a very simple animation that targets ANGLE and individual X Y Z fields. I managed to animate these joints correctly by linear interpolating the target fields and updating the target joints transform.
    Now I have a more complicated animation (max exported) which used IK solver nodes, the nodes were collapsed before exporting, but now I have <animation> <sources>'s which have <accessor> <param>'s which have names X Y Z and ANGLE, the target element is a <rotate> element within a <node>. I tried converting these AxisAngle pairs to quaternions and interpolating between them for a given time, then using the interpolated result as the joints transform for this in between time. But im unsure if this is how I should be using the axis angle, the resulting animation is incorrect. Ive tried using the resulting quaterion as the replacement for the joints local transform, I also tried concatenating it with the result from the last.
    The target skeleton joints transforms (<rotate><scale><translate>) seem to all animate, some target joint nodes seem to have multiple XYZ AXIS <animation> <channel>'s which seem strange. The following 3 <animation> <channel>'s for joint node "SecondLegEnd" for the first time key, seem to do a -13.2825 degree rotation, a 1 1 1 scale, and then a +13.2825 degree, wouldnt these cancel each other out being done all at the same key time? Oddly enough when this file is imported into Maya it runs fine.

    Code :
    <animation id="SecondLegEnd-node-sar">
                <source id="SecondLegEnd-node-sar_SecondLegEnd-node_ScaleAxisR-output">
                    <float_array id="SecondLegEnd-node-sar_SecondLegEnd-node_ScaleAxisR-output-array" count="404">-1 -6.1e-005 -0.000524 -13.2825 ...</float_array>
                    <technique_common>
                        <accessor count="101" source="#SecondLegEnd-node-sar_SecondLegEnd-node_ScaleAxisR-output-array" stride="4">
                            <param name="X" type="float"/>
                            <param name="Y" type="float"/>
                            <param name="Z" type="float"/>
                            <param name="ANGLE" type="float"/>
                        </accessor>
                    </technique_common>
                </source>
    </animation>
     
    <animation id="SecondLegEnd-node-scale">
                <source id="SecondLegEnd-node-scale_SecondLegEnd-node_scale-output">
                    <float_array id="SecondLegEnd-node-scale_SecondLegEnd-node_scale-output-array" count="303">1 1 1 ...</float_array>
                    <technique_common>
                        <accessor count="101" source="#SecondLegEnd-node-scale_SecondLegEnd-node_scale-output-array" stride="3">
                            <param name="X" type="float"/>
                            <param name="Y" type="float"/>
                            <param name="Z" type="float"/>
                        </accessor>
                    </technique_common>
                </source>
    </animation>
     
    <animation id="SecondLegEnd-node-sa">
                <source id="SecondLegEnd-node-sa_SecondLegEnd-node_ScaleAxis-output">
                    <float_array id="SecondLegEnd-node-sa_SecondLegEnd-node_ScaleAxis-output-array" count="404">-1 -6.1e-005 -0.000524 13.2825 ...</float_array>
                    <technique_common>
                        <accessor count="101" source="#SecondLegEnd-node-sa_SecondLegEnd-node_ScaleAxis-output-array" stride="4">
                            <param name="X" type="float"/>
                            <param name="Y" type="float"/>
                            <param name="Z" type="float"/>
                            <param name="ANGLE" type="float"/>
                        </accessor>
                    </technique_common>
                </source>
    </animation>

  2. #2
    Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Re: Help with <animation> <channel> XYZ ANGLE target

    I figured it out, having never done animation before, sadly it wasnt that big of a deal. Here it is for anyone that might need to know.
    My joint nodes (in my code) use Scale/Translate/Rotation as Vec3/Vec3/Quaternion so for the animation i didnt want matrix transform information, I wanted the individual parts. So when exporting a test animation from max, I did not bake matrices, resulting in <rotate> <translate> and <scale> elements instead of <matrix> transform elements for the scene <node>s. The Animations used IK solvers to help create the animation (they act as a tool not a final piece of the animation), I then had the joints (bones) in max collapsed (collapse trajectories, which removes the need for the IK solver nodes which can then be deleted from the max file before exporting, and creates frame data for the skeleton joints). This frame channel data was creating multiple rotation <source>'s across multiple <animation>'s all for the same joint (a joint would have multiple <animation>'s one doing Xaxis angle rotations, Yaxis rotations and now with the absence of the IK solver, an additional XYZ ANGLE rotation, a scale <animation> of 1 1 1, and another XYZ ANGLE rotation) for a given node name I simply had to combine all the rotation <animation>'s into a single set of rotation channel data for that node, and interpolate it each frame.
    Having never done this before, I was going through each individual set or rotation data and interpolating each of them, which seems like it should work, but doesnt, until combined all into one.
    So for each joint in this case, there should only be one scale, translate and rotation channel (or track, as its sometimes called). If there are many, combine and interpolate the result, not the individual parts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •