Jump to content

scene.beginAnimation--From,To?


ProfessorF
 Share

Recommended Posts

What do the from and to parameters in scene.beginAnimation represent?

 

I ask because Dude has 31 key frames (see image below). So originally I did:


                scene.beginAnimation(skeletons[0], 0, 30, true, 1.0);

but this didn't work. So I noticed in the Wiki that the examples used 100:


                scene.beginAnimation(skeletons[0], 0, 100, true, 1.0);

 

That works.

 

But it raises the question: What do "from" and "to" mean?  I have animation files that start at precise frames (idle, walking, running, etc) so I need to know how to convert from frames to whatever from & to mean.

 

Thank you in advance.

 

post-5799-0-30078700-1389061388.png

 

Link to comment
Share on other sites

Oh, okay.  I'm using FbxExporter, not the Blender exporter

 

If I use the FbxExporter on dude.fbx and I do 0..31,  I only get one-third of the animation.

 

Anyway I was experimenting with another model, and I've determined that beginAnimation from/to are percentages from 0..100

 

Because, in my other model (not dude.fbx), my subAnimations work fine if I use the following formula to convert from 0..100

 

from = keyframeStart/totalFrames * 100 // where totalFrame is all the frames in the animation, idle, walking, running, sitting, etc. 

to = keyframeEnd/totalFrames * 100

 

I'll experiment with the BlenderExporter...

 

Thanks!

Link to comment
Share on other sites

Haven't tried the Blender export yet, but just to make it clearer, below is Jock.  Jock's idle animation is 0..48, there are 520 frames total in Jock because the other frames have run, sit, walk, wave, etc. animations.

 

scene.beginAnimation(skeletons[0], 0, 48, true, 1.0) does not work.  It plays 48% of the frames

 

to get it to work I need to do:

 

scene.beginAnimation(skeletons[0], 100*0/520, 100*48/520, true, 1.0) 

 

post-5799-0-31620000-1389068319.png

 
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...