ProfessorF Posted January 7, 2014 Share Posted January 7, 2014 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 7, 2014 Share Posted January 7, 2014 from and to reference the key frame numbers. The blender exporter creates a first key at 0 and the last key at bpy.context.scene.frame_end - bpy.context.scene.frame_start So in your case it should work with 0, 31. What do you get when you're using these values? ProfessorF 1 Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted January 7, 2014 Author Share Posted January 7, 2014 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! Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted January 7, 2014 Author Share Posted January 7, 2014 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) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 7, 2014 Share Posted January 7, 2014 You're absolutely right:to be able to always have a single time referential, I rescale animations to 0..100 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.