Jump to content

AnimationLength()


macklebee
 Share

Recommended Posts

What am I not understanding here? The animation loads and I can animate the character with it, but i am unable to pull the length of the animation. i assume I am missing some fine detail in its usage?

 

require("scripts/class")
local class=CreateClass(...)

function class:CreateObject(model)
       local object=self.super:CreateObject(model)
local lodCount = CountModelLODEntities(model)
for LODEntity = 0, lodCount-1 do
	sequence = LoadAnimation(GetModelLODEntity(model, LODEntity),"abstract::run.gmf")
               Print("Length of animation: "..AnimationLength(model,sequence))
end

end

 

Always prints the length as zero... :D

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

nevermind... :D need to use the new LOD command...

 

require("scripts/class")
local class=CreateClass(...)

function class:CreateObject(model)
       local object=self.super:CreateObject(model)
local lodCount = CountModelLODEntities(model)
for lod = 0, lodCount-1 do
	sequence = LoadAnimation(GetModelLODEntity(model, lod),"abstract::run.gmf")
	Print("Length of animation: "..AnimationLength(GetModelLODEntity(model,lod),sequence))
end
end

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

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