Evening everyone, I have been looking at the animation codes and trying to replace parts of the character model animations instead of replacing the entire animation when calling cskel.animate(..., ..., ..., true). As an example, take a look at the simple code here:
Code:
cskel.animate(L"Data/Anim/walk.anim", ..., ..., ...);
cskel.animate(L"Data/Anim/aim.anim", ..., ..., true); // Should only replace upper body animation, not whole body animation; how do we do this in Esenthel?
The "aim.anim" affects the lower body and I don't want that to happen, I just want it to affect the upper body, without having to change the .anim resource (unless I have to).
So the second animation completely replaces the first. What I would like to do is replace only part of the first animation with the second animation. In other words, tell the second animation to replace the upper body animation only, not the whole body animation.
So I can create a combination of animations like "walk and aim".
Is this is at all possible in Esenthel? I have been looking through the various animation methods and tried a few bits of code but haven't managed it so far. I am still getting to grips with every aspect of the engine so apologies if it takes me a few topics of posts to try and understand it
Look forward to hearing from everyone
EDIT: This is theory but would something like this work? I haven't managed to get it to work yet.
cskel.animate("Data/Anim/walk.anim", ..., ..., ...); // initial animation
SkelAnim* aimAnim = cskel.findSkelAnim("Data/Anim/aim.anim"); // get aim animation data
// Step 1: Pull out keyframe data for the upper body only
// Step 2: For each bone in upper body: forceMatrix(boneIndex, keyframeMatrixForThisBone, true);
// Step 3: build final transform matrix using updateMatrix(MatrixIdentity);
// Step 4: updateVelocities();
EDIT I did try the above but got nowhere with it, don't think I am going in the right direction.