Jump to content

Parallel animations?


lionrouge
 Share

Recommended Posts

Hi !

 

What if i want to animate a complex model? A dragon for example. And i want to be able to activate head animations (look down or turn) and body animations (fly, run, etc.) separately. How can i do it?

 

As i understand it's not Leadwerks problem. Every frame of animation describes position of every face. Is there a way to describe relative displacement of faces(bones)? Not for entire model? Anyway i don't think Leadwerks supports it.

Link to comment
Share on other sites

I think he means split animation instead of animation blending.

 

If you are using Lua then make 2 AnimationManager instances. For one pass in the entire model entity and for the other find a bone using FindChild("bone name") on the entire model that will be the top most bone for that entire body part. ie you normally pick the spine for upper body and hips for lower.

 

Then you make sure you call animMgr:Update() for the entire model first, then call the upper/lower body one second so that it'll overwrite the entire body one but just for the parent bone you passed in.

 

self.animMgr = AnimationManager:Create(self.entity)
self.animMgrUpper = AnimationManager:Create(self.entity:FindChild("spine_bone_name")

function Script:Draw()
self.animMgr:Update()
self.animMgrUpper:Update()
end

 

You then manage calling self.animMgr:SetAnimationSequence() on both instances. It doesn't matter the order you call them on in UpdateWorld() as it's the Update() function that does the actual manipulation of the bones.

 

Note that inside Script:Draw() after you call the animation managers Update() you can also manually rotate/move bones as well. In one of my games I do this with the neck bone so when the player in 3rd person view looks up I rotate the neck bone slightly based on the camera pitch to give a more realistic look.

  • Upvote 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...