Gugis Posted January 3, 2017 Share Posted January 3, 2017 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 Quote Link to comment Share on other sites More sharing options...
Raggar Posted January 3, 2017 Share Posted January 3, 2017 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 Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 3, 2017 Author Share Posted January 3, 2017 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. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted January 3, 2017 Share Posted January 3, 2017 @Gugis Just use a url, instead of a relative path; http://www.babylonjs-playground.com/#U6CMY#1 Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 3, 2017 Author Share Posted January 3, 2017 27 minutes ago, aWeirdo said: @Gugis Just use a url, instead of a relative path; http://www.babylonjs-playground.com/#U6CMY#1 It gives CORS error. EDIT: Nevermind, I uploaded it to github and it works http://www.babylonjs-playground.com/#1WUHAN#1 Hold W key to change animation Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted January 3, 2017 Share Posted January 3, 2017 @Gugis where is your file hosted? can you upload it to github? Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 3, 2017 Author Share Posted January 3, 2017 16 minutes ago, aWeirdo said: @Gugis where is your file hosted? can you upload it to github? Yes it works with github. Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 4, 2017 Share Posted January 4, 2017 Your PG seems to work well Did I miss something? Quote Link to comment Share on other sites More sharing options...
adam Posted January 4, 2017 Share Posted January 4, 2017 The bones aren't maintaining the correct scale while tweening. Look at the head here: https://gyazo.com/f32c07d151b9bae3afcc1825f1871361 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 4, 2017 Share Posted January 4, 2017 oh yes..Interesting.. Tweening is done with a simple lerp between values: https://github.com/BabylonJS/Babylon.js/blob/796920ee3b9572925745e066ce609e052a613de7/src/Animations/babylon.animation.ts#L489 I'm not sure how we can help fixing your issue Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 4, 2017 Share Posted January 4, 2017 Are you sure your animation is correct? (I mean the head is the same in both poses?) Quote Link to comment Share on other sites More sharing options...
adam Posted January 4, 2017 Share Posted January 4, 2017 I think this could be related to this issue: Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 4, 2017 Share Posted January 4, 2017 To fix the blend issue we moved to Lerp: https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L2831 But when I check the animation I'm almost convinced that parts are squezzed because they are not stricly the same between two animations Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 5, 2017 Author Share Posted January 5, 2017 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? Quote Link to comment Share on other sites More sharing options...
gryff Posted January 5, 2017 Share Posted January 5, 2017 @Gugis : can you post the .blend file with the two animations so that I can take a look? cheers, gryff Quote Link to comment Share on other sites More sharing options...
joshcamas Posted January 5, 2017 Share Posted January 5, 2017 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. Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 5, 2017 Author Share Posted January 5, 2017 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. 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. Quote Link to comment Share on other sites More sharing options...
gryff Posted January 5, 2017 Share Posted January 5, 2017 @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. 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 !! 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 . 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 Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 6, 2017 Author Share Posted January 6, 2017 Yes I have noticed that too. Also i have to reapply scale for objects over and over again before exporting to .babylon otherwise animations become distorted. Do you think these are related to squeezing problem? Quote Link to comment Share on other sites More sharing options...
gryff Posted January 6, 2017 Share Posted January 6, 2017 @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 Quote Link to comment Share on other sites More sharing options...
Gugis Posted January 6, 2017 Author Share Posted January 6, 2017 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 :/ Quote Link to comment Share on other sites More sharing options...
adam Posted January 6, 2017 Share Posted January 6, 2017 I changed Matrix.Lerp to Matrix.DecomposeLerp here on line 39: http://www.babylonjs-playground.com/#1WUHAN#4 Does anyone know why that would cause the model to invert during blending? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 6, 2017 Share Posted January 6, 2017 Because the decompose can decompose to non linear values between calls Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 6, 2017 Share Posted January 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 6, 2017 Share Posted January 6, 2017 Yeah I remembered it when I saw the PG created by Adam 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.