I simplified a bit, so only one dress is loaded and parts are taken. Also it seems the animation on a mesh that’s parent or rig has changed stops animating, so after re-playing animationgroup of dress rig it gets into correct pose:
subanimationGroups[0].play()
Here the PG:
I guess retarget animations or clone animationGroup are optimal options. Here are similar topics:
To my knowledge, there are atleast two possible ways to do this:
1. animationGroup.clone()-function:
If bone names are identical on both skeletons (else you have to rename), the targetConverter would look similar to this:
(target) => {
let idx = skeletons1[0].getBoneIndexByName(target.name)
return skeletons1[0].bones[idx]
}
2. create animationGroup and add animations with targets:
var newAnimationGroup = new BABYLON.AnimationGroup("newGroup");
for (var {target, animation} of impor…
playground: https://playground.babylonjs.com/#8LFTCH#2020
Hi everyone, in the above playground I have shown how I load a model with animations and clone it several times in such a way that I can independently use the animations on each of the copies. My need is that I have models with different looks, which supposedly use the same standard humanoid model, as far as the skeleton is concerned.
And a lot of the animations that I want to put on my models duplicate each other, so if it is possible,…
First thing you did wrong is combining both methods. There is no need to use clone and addTargetedAnimation together. You have to stick to one way. Next is that in your first .glb-import, you unneccessarily cloned animationGroup and then you clone again in second .glb-import. Cloning in second would be enough here. Also you created an animationGroup, which is already imported, then you try to addTargetedAnimation to the createdAnimationGroup with importedAnimationGroup as animation and clonedAni…
Hi! Thanks for your reply. I tried using method number two in this playground: https://playground.babylonjs.com/#AHQEIB#1825 but for some reason it’s not working.
The result is, as you’ll see, that parts of the character mesh simply just get displaced. I’m still very new to animation in Babylonjs, so I apologize of I’m missing something obvious. Thanks in advance.
2 Likes