Skinmesh for Tiny problem with Key
I expected to have a Skeleton Start Position for Tiny with arm Stretch on the side
Apparently there is no base Skeleton in the file (maybe there is, I don't know)
I managed to add my key to an AnimationSet Skeleton in pause mode (loiter)
Now When I add my angle I loose the Translation and Rotation
of the original pause Skeleton
What do I miss here ? How are people adding rotation key ?
Do I also need to extract the previous original rotation to add mine ?
Where is the initiale Skeleton of Tiny that tell each bone it's first position ?
How can I Add Rotation on top of the Normal rotation pause value ?
Also,
Apparently I cannot save Key change when I'm in play mode
What do I need at minimum to be on pause or stop ?
Simply not refresh Skeleton Bone while I save ?
Can I render it while I save ? (just not refresh skeleton move)
Do I need to reset some stuff after each time I change a Key ?
Any help would be appreciated :-)
Well, I made it work somewhat
I take the Translation from the Loiter in pause position, this give me the correct
translation before I add my Translation key
For the Rotation, I think I would need to Multiply quaternion and then Slerp
so It's way too complicated, so for the rotation I'll compensate with mine
As for the Stop, I made this work too...as long as you don't move the skeleton while you add your key it's working
Still, I think it must have another way to get the original Skeleton value
in pause so we can work from there
I will allways have to make sure I have a loiter animation so I can extract my start move
An if I want it to work in all software I need to save those value even if they don't actually change in the animation...
I don't quite understand what you're actually after. What are you actually trying to do with this data? Why are you changing the animation data within the Tiny.x mesh?
When it comes to a skeleton identity pose, the "bind pose" (as you'd find in the ISkin or Physique modifier) is not stored. However, you can assume that the first pose in the file is the "normal" pose, and do all your math based on that (it's easy to get this pose by loading the hierarchy manually), and that'll work fine. Or you can get an arbitrary pose, and invert all the transforms, so that you're assuming identity transforms for all bones, if you prefer that.
Thank very much for your answer :-)
I use the tiny_4anim.x and try to animate with the AnimationSet
I'm experimenting with it and I though that with no animation move that
I would get the ''bind pose''...some kind of rest position
But probably that I don't load my skeleton correctly
The problem is that in order to Skinmesh you need some animation
and I want the animation that does't move at all...just to see
in what kind of position the Hierarchy skeleton is with no animation...
So I can later add my animation to it from that position
For the ''bind pose'' I see that the Skeleton is in the hierarchy, so I assume
the value of those frame are the ''bind pose'', I will read those value
to get my ''bind pose'', so I beleive it is saved in the file...I hope
In the file if you call Walk and then Wave, the position stay the same and
only the Arm move while the position of tiny stay in walk position
Because Wave don't use all 46 frame/Bone all other motion is stop at the current position and only the arm is animated, the wave animation only move from the last position
When I call the Walk the Mesh animated all the 46 bone normally
I want to be able to load the ''bind pose'' and just add the minimum animation
from that
Probably that I dont load my hierarchy correctly Because when I have only one bone animated all the other bones seems to go to 0,0,0
It's like I don't ADD to the pose positon
''Why are you changing the animation data within the Tiny.x mesh?''
Simply to add more animationset...
When you say:
that the first pose in the file is the "normal" pose
You mean the Skeleton, but how to draw it without animation to transform it and then
Skinmesh it? I need to check my code how to draw without animating the base skeleton
When you say:
a skeleton identity pose
The skeleton matrix are not identity but the real skeleton translated and rotated,
It's the animation that are identity ?
I will try to only load the hierarchy without animation and see this ''bind pose''
For now all work base on one animation frame first value,
but I want to be able to see and modify this first Skeleton pose
Are the Bone animation replacing the Skeleton Matrix or do they add to it ?
I look like they replace them...(I'll look in my code why they don't add to it)
I put a Animation that did nothing just to see the ''pose'' value saved in
the hierarchy and I get a tiny that is spread like in a walk and arms slightly extended
on his side, Basically I think this is the start position if you don't animate the bone
When I add a rotation to a leg the Leg go up because I replace the rotation
contained in the original Hierarchy that put the leg matrix down
Each Frame contain a transformation matrix at start that place the ''pose''
When you animate you replace those matrix
But the only way to save an animation frame is to use Scale, translation, Rotation value
So I have the original matrix in the original hierarchy, and the rotation
that I can transform into a matrix and multiply by the original matrix to get
the matrix original + the Matrix of the rotation I want to add
Everything is nice exept that now I have
to convert a Matrix to a scale, translation, rotation value in order to save it...
is there a way to get the rotation angle from a matrix ?
(I can read the translation in the matrix...)
I just found the function to do this :-)
I have everything I need now, so I'll check the post as answered
D3DXMatrixDecompose
Breaks down a general 3D transformation matrix into its scalar, rotational, and translational components.
HRESULT D3DXMatrixDecompose( D3DXVECTOR3 * pOutScale, D3DXQUATERNION * pOutRotation, D3DXVECTOR3 * pOutTranslation, CONST D3DXMATRIX * pM ); Parameters
- pOutScale
- [in, out] Pointer to the output D3DXVECTOR3 that contains scaling factors applied along the x, y, and z-axes.
- pOutRotation
- [in, out] Pointer to the D3DXQUATERNION structure that describes the rotation.
- pOutTranslation
- [in, out] Pointer to the D3DXVECTOR3 vector that describes the translation.
- pM
- [in] Pointer to an input D3DXMATRIX matrix to decompose.
Return Values
If the function succeeds, the return value is S_OK. If the function fails, the return value can be the following: D3DERR_INVALIDCALL.
Requirements
Header: Declared in D3dx9math.h.