Roland Posted July 17, 2014 Share Posted July 17, 2014 Hello there I have been away soooo long from Leadwerk, but intends to start again. This time I'm trying to use LUA for testing things (C++ will be used more later on). Anyway. I have the same model exported to 3 separate fbx files with a unique animation in each of them (idle, walk and run). Each of them looks and animates OK when dragged into the scene. I then dragged the idle fbx to the scene and attached a script to load the animations and toggle between them. Whooo that came out weird! Here is the script I have attached to the guy out on the left side in the attached video function Script:Start() self.idle = self.entity:LoadAnimation("Models/Characters/eric/eric_idle.mdl") self.walk = self.entity:LoadAnimation("Models/Characters/eric/eric_walk.mdl") self.run = self.entity:LoadAnimation("Models/Characters/eric/eric_run.mdl") self.cur = self.idle end function Script:UpdateWorld() local window = Window:GetCurrent() if window:KeyHit(Key.Space) then if self.cur == self.idle then self.cur = self.walk elseif self.cur == self.walk then self.cur = self.run elseif self.cur == self.run then self.cur = self.idle end end self.entity:SetAnimationFrame(Time:GetCurrent()/30.0,1,self.cur,true) end Is this code a wrong or is the problem somewhere else? Any suggestions? Here is a video showing the problem http://northwerk.com/videos/le2.mp4 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Marleys Ghost Posted July 17, 2014 Share Posted July 17, 2014 Do the models share the same animation rig and have matching bone names? looks like an interpretation failure between them. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Roland Posted July 17, 2014 Author Share Posted July 17, 2014 Yes Marley. The model is the same rigged model, just with different animations. It's really strange IDLE WALK RUN Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Marleys Ghost Posted July 17, 2014 Share Posted July 17, 2014 Have you tried loading the animations into the model using the model editor? 1 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Roland Posted July 17, 2014 Author Share Posted July 17, 2014 Didn't know that could be done. Will try that. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Roland Posted July 17, 2014 Author Share Posted July 17, 2014 YES! Marley you are my favorite Ghost That solved the problem. Thanks a lot Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Marleys Ghost Posted July 18, 2014 Share Posted July 18, 2014 No problems Roland, glad the info was of use. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" 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.