lionrouge Posted September 22, 2014 Share Posted September 22, 2014 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. Quote Link to comment Share on other sites More sharing options...
Guppy Posted September 22, 2014 Share Posted September 22, 2014 http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetanimationframe-r141 you just have to decide the blend factor your self ( usually 1/number of animations playing simultaniously ) Quote System: Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k Link to comment Share on other sites More sharing options...
Rick Posted September 22, 2014 Share Posted September 22, 2014 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. 4 Quote Link to comment Share on other sites More sharing options...
lionrouge Posted September 22, 2014 Author Share Posted September 22, 2014 Thank you, Rick, looks like a decision. I will try it and report. Quote Link to comment Share on other sites More sharing options...
Einlander Posted September 22, 2014 Share Posted September 22, 2014 Can we get this on the Wikidot site? Also is bone access available to lua or is it just in c++? Quote Link to comment Share on other sites More sharing options...
Rick Posted September 22, 2014 Share Posted September 22, 2014 FindChild(), which is how you get bones, is available to both Lua & C++ Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 22, 2014 Share Posted September 22, 2014 Lua and C++ example here: http://www.leadwerks.com/werkspace/page/tutorials_legacy/_/introduction-to-animation-r14 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.