BBL throw this error when select AnimationGroup in Inspector


It is only throw when I select animationGroup has animations, It is only happened in local space.
If I select one , it throw error, I click Edit

If I select another, and click Edit

I try to use less code to show it:

import { Engine, Scene, Vector3, WebGPUEngine, MeshBuilder, StandardMaterial, PBRMaterial, DirectionalLight, HemisphericLight, FreeCamera, AnimationGroup, Animation, IAnimationKey } from “@babylonjs/core”;

import { Inspector } from “@babylonjs/inspector”;

export type ILoadSceneData = {

domID: string

}

const loadScene = (data: ILoadSceneData) => {

loadSceneAsync(data);

function loadSceneAsync(loadData: ILoadSceneData) {

    const container = (document.getElementById(loadData.domID) as HTMLCanvasElement) || new HTMLCanvasElement();

    const engine = new Engine(container);

    const scene = new Scene(engine);

    scene.useRightHandedSystem = true;

    const camera = new FreeCamera("A", Vector3.Zero(), scene);

    const p = {

        a: 0

    }

    const animationG = new AnimationGroup("a", scene);

    const animation = new Animation('a', "a", 100, Animation.ANIMATIONTYPE_FLOAT);

    const keys: IAnimationKey[] = [

        { frame: 0, value: 0 },

        { frame: 1, value: 1 }

    ]

    animation.setKeys(keys);

    animationG.addTargetedAnimation(animation, p);

    Inspector.OnSelectionChangeObservable.add(() => {

    })

    scene.debugLayer.show();

    return;

}

}

export { loadScene };

It is no problem in PG.

It is my package
image

Why are you using addTargetedAnimation to add an animation to a non-Babylon object (the “p”)? What happens if you add this same animation to a Babylon object, does the error still happen?

It still happened :sob:

Are you sure you can’t reproduce this on the Playground? If not, can you share your project with us through GitHub or any other code sharing platform? It is hard to understand what is happening without a working repro.

1 Like

Hello here is git: GitHub - Moriyer/BBLBugTest

The project has a lot of non-babylon related code, are you able to share something with just what’s strictly necessary to consistently reproduce the bug? If not, it’s probably your setup that’s causing the issue.