Models broken when updating from v4 to v5/v6

Are there known breaking changes between 4 and 5? In particular, animation broke (sporadic quick small movements). Any ideas?

Here’s the issue tracking the breakage in the particular project:

Add support for BabylonJS v5 · Issue #155 · aws-samples/amazon-sumerian-hosts (github.com)

If you run the project demo as is, you’ll see how they work, then update the Babylon version in package.json and you’ll see the breakage.

DM me for the AWS key (requires a bit of a dance inside the AWS UI setting up multiple services and exposing them through an Identity).

from the docs here
.glTF 2.0 Skinning | Babylon.js Documentation
says:
" NOTE: Before Babylon.js 5.0, the glTF loader uses a property overrideMesh that on the skeleton to override the mesh used by the skeleton in order to ignore the parent transform up to the glTF root node which contained the right-hand to left-hand conversion. This method, however, caused all sort of issues that are outside the scope of this document to explain. This property has since been removed from the skeleton class.

using that or not, there were still some changes to the structure of the json.

i only quickly looked at the sumarian host, i didnt see anything that stood out immediately besides accesing the animation group by 0 index. perhaps __root__ is now the 0 index and the animations are at 1. idk, maybe just console log the json and see what’s different, shouldn’t be too difficult to rule a change in shape of the parsed animations. i think if the parsed json is different, it could be the additive animations. i saw many broken playgrounds, but idk about any changes to additive animations first hand.

another maybe helpful thing is comparing these two playgrounds. somewhat illustrates how the changes to the json can be breaking.
https://playground.babylonjs.com/#WKJTFD#42 (working in v4, broke in v5/6)
https://playground.babylonjs.com/#WKJTFD#57 (fixed)
see around lines ~215 for the changes

cc @Evgeni_Popov

As @jeremy-coleman pointed, we have a breaking change when loading a glTF file in 5.0.

For context, here’s the post from @bghgary regarding the PGs:

Also, make sure to have a look at the breaking changes for v5, as there are more than usual:

https://doc.babylonjs.com/whats-new

(search for “5.0.0” then “Breaking changes”)

cc @trusktr

I think additive animation blending is broken.

this is playground is one from the docs on animation blending.
.Advanced Animation Methods | Babylon.js Documentation
.https://playground.babylonjs.com/#6I67BL#321

i opened the playground twice, so i had two tabs open. i played the animations and adjusted some weights and the skeleton was deforming. but i noticed, the skeleton was deforming in the same way from adjusting different animations. the screenshots below show the problem. the first two pictures are from tab1, and the last 3 are from tab2. In the first two, adjusting “head shake” caused her to go cross armed. In tab2, adjusting “agree” caused her to go cross-armed. Finally, i adjusted “head shake” in tab2 just to show it has no effect, while in tab1, it is the cause of the problem. (instructions to reproduce below).





steps to reproduce:

open the playground here
.https://playground.babylonjs.com/#6I67BL#321

play the “walk” animation.
adjust animations in this order: sad → sneak → head → agree.
“agree” will cause the model to become deformed

reopen the playground to reset animations.

play the “walk” animation
adjust animations in this order: sneak → head → agree → sad
“sad” will cause the model to become deformed

What is the actual reproducing action here? is it just using any more than 3 additive blending animations will cause the problem?

1 Like

The problem is that the PR is a bit bugged, but the bug makes your use case work…

If you select v5.71.1 in the Playground and apply your steps, it works. Now, if you set 0 in line 228 instead of param.anim.weight, it does not work anymore. That’s because param.anim.weightdoes not exist and return undefined. Because the slider value is set to undefined, the onValueChangedObservable is immediately called with the 0 value, to set a legitimate value. This is done for all the 4 additive animations, which initializes them correctly.

The bug in the PG is that the 4 additive animations should be initialized with a 0 weight. The default one (-1) is invalid for additive animations.

So, here’s a fixed PG, using the AnimationGroup.weight property instead of calling setWeightForAllAnimatables manually:

I also fixed the PG in the doc:

1 Like

nice, maybe some useful insight for truskr / amazon folks

also noteworthy change i think:

slider.onValueChangedObservable.add((v) => {
 				param.anim.weight = v;
				param.weight = v;
				header.text = param.name + ":" + param.weight.toFixed(2);
})

changed to:

slider.onValueChangedObservable.add((v) => {
			param.anim.setWeightForAllAnimatables(v);
			param.weight = v;
			header.text = param.name + ":" + param.weight.toFixed(2);
})

I changed to param.anim.weight = v; because it’s more logical now that we have a weight property on the AnimationGroup, but calling setWeightForAllAnimatables still work.

I’m not sure what the problem is with Amazon Sumerian models. But I noticed something.

If I take the above broken Babylon example, https://playground.babylonjs.com/#6I67BL#321, and downgrade it to 4.x, it starts to shake like this:

I am also experiencing vibration like that when upgrading from 4.x to 5.x:

Note the face shape is all distorted too.

Does this provide any clues?

Here’s the open source: amazon-sumerian-hosts/packages/amazon-sumerian-hosts-babylon/src/Babylon.js/HostObject.js at mainline2.0 · aws-samples/amazon-sumerian-hosts · GitHub

(search for “animation” and you’ll find lots of results).

Do you see anything wrong there?

I looked at https://doc.babylonjs.com/whats-new, but I don’t see anything obvious.

Does it work in the latest version of Babylon? We did quite a few number of fixes and improvements since v4 / v5:

Also, these threads could help:

1 Like