Anyone able to see why maybe i cannot import the animation and attach it to the model. when it gets imported, an animation group is created, however, the targetedAnimations variable isn’t loaded, so there’s nothing to actually attach to the model. both the model and animation pass kronos validator. Something must obviously be missing or wrong in the exporter i’m making for unreal 2k4 models…
cannot save the playground:
XHROPTIONShttps://snippet.babylonjs.com/CORS Preflight Did Not Succeed
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://snippet.babylonjs.com/. (Reason: CORS preflight response did not succeed). Status code: 400.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://snippet.babylonjs.com/. (Reason: CORS request did not succeed). Status code: (null).
playground source:
export const createScene = function () {
const scene = new BABYLON.Scene(engine);
scene.clearColor = new BABYLON.Color4(0.1, 0.1, 0.2, 1);
const camera = new BABYLON.ArcRotateCamera("cam", Math.PI / 2, Math.PI / 3.5, 15, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
const light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
let skeleton = null;
BABYLON.SceneLoader.ImportMeshAsync("", "https://raw.githubusercontent.com/reddozen/split_animations/refs/heads/main/", "Sophie_Tristan.gltf", scene).then((result) => {
const npcMesh = result.meshes\[0\];
npcMesh.npcId = 0;
skeleton = result.skeletons\[0\];
BABYLON.SceneLoader.LoadAssetContainerAsync("https://raw.githubusercontent.com/reddozen/split_animations/refs/heads/main/Animations/", "NPC_G_Stand01.gltf", scene).then((container) => {
const sourceGroup = container.animationGroups\[0\];
console.log("Source animationGroup name:", sourceGroup.name);
console.log("Source targetedAnimations count:", sourceGroup.targetedAnimations.length); // ← this will be 0 or small
const newGroup = new BABYLON.AnimationGroup("NPC_G_Stand01_i0", scene);
for (const ta of sourceGroup.targetedAnimations) {
const boneName = ta.target.name;
const bone = skeleton.getBoneByName(boneName);
if (bone) {
console.log("Retargeting bone:", boneName);
newGroup.addTargetedAnimation(ta.animation.clone(), bone);
} else {
console.warn("Bone not found:", boneName);
}
}
newGroup.normalize(0, sourceGroup.to);
scene.addAnimationGroup(newGroup);
newGroup.start(true);
container.dispose();
}).catch(e => console.error(e));
});
return scene;
};