Jump to content

[Solved] How to join animation from separate FBX files to a model


Roland
 Share

Recommended Posts

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

AV MX Linux

Link to comment
Share on other sites

Do the models share the same animation rig and have matching bone names? looks like an interpretation failure between them.

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

Have you tried loading the animations into the model using the model editor?

  • Upvote 1

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

No problems Roland, glad the info was of use.

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

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...