Jump to content

There's something funny about character animation blending


Gugis
 Share

Recommended Posts

I don't know if it's relevant issue, but I noticed something strange about skeletal animations blending. When animationBlending is set for skeleton there's strange squeezing in and squeezing out while transition between two animations is happening.

Here https://gyazo.com/f32c07d151b9bae3afcc1825f1871361 (it's best seen looking at character's head).

Is there something I can do about it? I don't know if it's a bug or I messed up something with animations, but  without blending animations looks fine.

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

Hold W key to change animation

Link to comment
Share on other sites

15 minutes ago, Raggar said:

It makes it a lot eassier if you post a Playground example, as otherwise, people will have to blindly guess what the problem 'might' be :)

I don't know how to load babylon scene in playground from external url.

Link to comment
Share on other sites

I checked skeleton and mesh in blender and it looks fine. Squeezing happens only when blending is happening. It squeezes in when transition starts and squeezes out before transition is ended. If that's not Babylon bug, maybe Blender exporter has something to do with this?

Link to comment
Share on other sites

I think this is an export problem. If you completely disable blending, the problem persists - the animation seems to not end on the same frame as it starts, or a frame you don't want is somewhere inside. As gryff said, a blend upload would be the best. :D

Link to comment
Share on other sites

1 hour ago, gryff said:

@Gugis : can you post the .blend file with the two animations so that I can take a look?

cheers, gryff :)

https://github.com/Gugis/test/blob/master/assets.blend

32 minutes ago, joshcamas said:

I think this is an export problem. If you completely disable blending, the problem persists - the animation seems to not end on the same frame as it starts, or a frame you don't want is somewhere inside. As gryff said, a blend upload would be the best. :D

That's because Blender exported animation ranges wrong. Before there was babylon file with fixed animation ranges, but now I have just updated with this file.

Link to comment
Share on other sites

@Gugis : TY for the file :)

I have taken a quick look and the Blender file seems ok - apart from the 65 bones!! Typical of many Mixamo models - 42 bones in the hands which are basically not animated over the frame animations. :o

One possible issue that I did notice when I did an export from Blender and looked at the .babylon file:

"ranges":[{"name":"attack_with_shield_moving","from":0,"to":40},{"name":"idle_with_shield","from":50,"to":127},{"name":"run_with_shield","from":140,"to":162},{"name":"walk_with_shield","from":170,"to":204}]

That line defines the frame ranges for each animation you are using BUT here are the frames for the head:

{"name":"mixamorig:Head","index":5,"matrix":[0.9739,0.0085,-0.2266,0,-0.0746,0.9557,-0.2849,0,0.2142,0.2944,0.9314,0,0,0.0679,0.0225,1],"rest":[1,0,0,0,0,1,0,0,0,0,1,0,0,0.0679,0.0225,1],"parentBoneIndex":4,"length":0.269
,"animation":{"dataType":3,"framePerSecond":30,"keys":[
{"frame":1,"values":[0.9938,-0.0614,0.093,0,0.0961,0.895,-0.4356,0,-0.0565,0.4418,0.8953,0,0,0.0679,0.0225,1]},
{"frame":2,"values":[0.9738,-0.1798,-0.1394,0,0.1298,0.9422,-0.3088,0,0.1869,0.2826,0.9409,0,0,0.0679,0.0225,1]},

Notice no frame zero !!:o Similarly :

{"frame":39,"values":[0.8909,-0.1491,-0.429,0,0.0859,0.9829,-0.1631,0,0.446,0.1085,0.8884,0,0,0.0679,0.0225,1]},
{"frame":40,"values":[0.9124,-0.1126,-0.3935,0,0.0796,0.9919,-0.0993,0,0.4015,0.0593,0.9139,0,0,0.0679,0.0225,1]},
{"frame":51,"values":[0.9124,-0.1126,-0.3935,0,0.0796,0.9919,-0.0993,0,0.4015,0.0593,0.9139,0,0,0.0679,0.0225,1]},
{"frame":52,"values":[0.9126,-0.1145,-0.3925,0,0.0813,0.9916,-0.1002,0,0.4007,0.0596,0.9143,0,0,0.0679,0.0225,1]},

No frame 50 :o. And it is the same with frame 140 and 170 - they don't exist. If I play just one animation in the range I get a jerk/twitch as it loops

@JCPalmer : any thoughts Jeff?

Will investigate more later this evening

cheers, gryff :)

Link to comment
Share on other sites

@Gugis : Well I took another look at your file and exported it*** - and used it instead of your file in the PG

My Playground

You will noticed I made some changes to your script:

1. Changed the ArcRotate parameters and added a line to control "wheelPrecision" so it zooms with some control.

2. I REMed the line #32 about the scaling as it is not needed because of 1.

3. The big change - line 31 - I changed the blending parameter to 0.25

It looks fine now :) .

And just so you can check easily, I made the same changes to:

Your Playground

It looks fine too. :)

*** I did make a couple of changes to the blend file.

1. I changed the default Sstart frame" to 1 under the "Camera tab" in the Properties Panel

2. In 3D Window, I hit N Key to bring up the 3D window properties, then "Selected" the Armature in the Scene Outliner panel and put the Armature into the "Rest Position". Note the Transform settings in the panel that was opened in the 3D Window. Now, I "Selected" the "man" mesh - note the -ve signs.. So I applied the Location and then Rotation and Scale. I always like the Transform values to be identical!

And I changed the "Start" values for the "Ranges"  manually in the resulting .babylon file.

What do you think ?

cheers, gryff :)

Link to comment
Share on other sites

10 hours ago, gryff said:

@Gugis : Well I took another look at your file and exported it*** - and used it instead of your file in the PG

My Playground

You will noticed I made some changes to your script:

1. Changed the ArcRotate parameters and added a line to control "wheelPrecision" so it zooms with some control.

2. I REMed the line #32 about the scaling as it is not needed because of 1.

3. The big change - line 31 - I changed the blending parameter to 0.25

It looks fine now :) .

And just so you can check easily, I made the same changes to:

Your Playground

It looks fine too. :)

*** I did make a couple of changes to the blend file.

1. I changed the default Sstart frame" to 1 under the "Camera tab" in the Properties Panel

2. In 3D Window, I hit N Key to bring up the 3D window properties, then "Selected" the Armature in the Scene Outliner panel and put the Armature into the "Rest Position". Note the Transform settings in the panel that was opened in the 3D Window. Now, I "Selected" the "man" mesh - note the -ve signs.. So I applied the Location and then Rotation and Scale. I always like the Transform values to be identical!

And I changed the "Start" values for the "Ranges"  manually in the resulting .babylon file.

What do you think ?

cheers, gryff :)

Thanks gryff. You increased blending value so transition happens faster and it's harder to notice the glitch, but that does not solves the problem :/

Link to comment
Share on other sites

10 minutes ago, Deltakosh said:

Because the decompose can decompose to non linear values between calls

So it this why you switched away from decompose method from Lerping?  You could not remember the reason in the earlier topic @adam referenced above.  This would explain why I never could find a problem in QI.  There I store everything decomposed already.  I was doing it for performance reasons, but guess there is also another reason.

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