Jump to content

Skipping frames in Blender animation export


ozRocker
 Share

Recommended Posts

I've been exporting my animations using Babylon exporter 4.4.4.  I notice that the end result is missing a frame at the beginning or end so when the animation is looping there is a noticeable skip.

This is what my Blender animation looks like:

 

Here's a playground with those animations exported:

http://www.babylonjs-playground.com/#1IGIDN

These are my ranges:

"ranges":[{"name":"Idle","from":1,"to":199},{"name":"Run","from":201,"to":214},{"name":"Walk","from":216,"to":238}]

I noticed there's a frame gap between the ranges so I removed the gap.  

"ranges":[{"name":"Idle","from":1,"to":199},{"name":"Run","from":200,"to":214},{"name":"Walk","from":215,"to":238}]

Both walk and run look smoother without that gap which you can see here:

http://www.babylonjs-playground.com/#1IGIDN#1

However they still appear to be missing a frame.

Any ideas how I can fix this?

Link to comment
Share on other sites

Guess that makes you the grandfather.  Yes, the skipping frame issue was talked about 3 weeks ago.  Fact is I do not have a blend where the animation is smooth enough to know whether a frame was missing or not.  The change is probably going to be very small change to some looping check.  The gap is intentional though, as just a sanity check.  Look at your .babylon.  Bet there is no frame 200, or 215 in the file.  As of 4.4.4, line breaks are put in every frame to make this easy to check.

We are still suffering are from the intro of Blender Actions as BJS animation ranges, and support for inverse kinetics which were introduced in version 4.2.  It looks to bad to have a fifth bug fix version, 4.4.5, so I have already added a quick enhancement from 5.0 TOB to allow it to be 4.5.0 (an additional 10% in .babylon size).  If you provide a blend, I can get to the bottom this.

Link to comment
Share on other sites

Ok, I found the missing last frame.  Basically each action has a range element, which is a 2 element array.  I was generating all the frame #'s from a function, whose 2nd argument was an "up to but including" type.  Add one, and you get your missing frame.  I have also made the gap between animations ranges wider, in addition to reducing the export file size about 10% more.  There will now be a gap of at least 5 frames, starting on an even multiple of 10.

The exporter now logs more info for each action in:

processing action Idle:  in[0 - 200], out[0 - 200]
processing action Run:  in[0 - 15], out[210 - 225]
processing action Walk:  in[0 - 24], out[230 - 254]

I have noticed that whatever you are doing to get the motion capture loaded, there are non-integer frames being generated in the .blend.  The ranges are actually:

action.frame_range 0.0 - 200.0
action.frame_range 0.0 - 15.199993133544922
action.frame_range 0.0 - 24.799991607666016

FYI, I also listed each frame & none of them is an integer.  Now when the export happens, the exporter sets the scene to an integer "frame" in time.  Blender interpolates between the 2 closest data points.  That is what is in the export. 

I need to build my own test before I PR.  Google drive is https, so I doubt the browser is going to let me modify your playground.  You're probably sleeping now.  Likely PR will be done by the time you are up.

Link to comment
Share on other sites

Ok, PR in progress.  Also noticed that my scene does not have for lack of a better term "fucked up" left foot.

Even in the idle action, the foot is wrong.  Did I do anything?  I am running a version of 2.4 that I built myself from Gulp on May 5th.  What is the playground running?  I saw something on Matrix.Lerp being wrong.  Do not know if this is in my file, but I do have the companion max file, if needed.

 

Link to comment
Share on other sites

Quote

I have noticed that whatever you are doing to get the motion capture loaded, there are non-integer frames being generated in the .blend. 

Yes Jeff I noticed that too when I looked at the files. Oz is using some Mixamo animation files - looks like the "free samples" that include an "idle" animation. I have this free sample so I imported it into Blender 2.76 in different two ways. ( A & B in image below.)

A: animation loaded with the "frame rate" in Blender set at 24fps. Result the last frame is 200 in the action editor.

B: animation loaded with the "frame rate" in Blender set at 30fps. Result the last frame is 250 in the action editor.

If I look at this idle animation in the Autodesk FBX Convertor - the last frame is 250.

Checking the file oz posted above - it has that "frame rate" value set to 24 which may explain those non-integer frames and why the last frame is 200.

cheers, gryff :)

framerate1.png

Link to comment
Share on other sites

That's correct.  They are standard Mixamo animations.  Yep, I left the Blender framerate as the default.  I didn't even think of changing it but I can see how that would cause some problems.  So there's a fix for me to do.  thanks guys!

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