This is my code block.
Previously with using canvas and plain Babylon
let casiBody = await scene.getMeshByName(“bubble_short_primitive1”);
This was working fine,
const onSceneMount = async (e: any) => {
const { scene } = e;
let casiBody = await scene.getMeshByName(“bubble_short_primitive1”);
console.log(casiBody, “”);
// casiBody.morphTargetManager.getTarget(0).influence = 1
};
But now I am unable to get scene.getMeshByName(“bubble_short_primitive1”);
Because the onSceneMount is loading before loading children components [ Model ]
Or Should I use the morphTargetManager prop to change the Morph targets.
<Model
rootUrl={https://raw.githubusercontent.com/ml-bhanuprakash/babylonjs/main/test_3/
}
sceneFilename={blouse_03.glb
}
scaleToDimension={0}
// morphTargetManager={ MorphTargetManager. }
// scaling={new Vector3(1,1,1)}
onModelLoaded={async (model) => {
await onModelLoaded(model);
// setLoadModel1(true);
}}
name={""}
></Model>