How do I call morphTargetManagers in the babylon file and use it?

lALPDgQ9razqcy_NAvvNBJc_1175_763.png_620x10000q90g

When I use getMorphTargetManagerById seemed not to work?I use the scene behind. I use the scene. MorphTargetManagers [0];To get here, but in the use of var manager = new BABYLON. MorphTargetManager ();Time doesn’t work, right?

I am sorry I have a lot of trouble understanding your question. Could you please share a playground of the issue ?

First get the mesh with the shapekeys with something like this:

var myMesh = myScene.getMeshByName(“theMesh”);

then, supposing it has three shapekeys, apply the influence you want each for each target with code like this:

myMesh.morphTargetManager.getTarget(0).influence = value0;
myMesh.morphTargetManager.getTarget(1).influence = value1;
myMesh.morphTargetManager.getTarget(2).influence = value2;

Hope that helps,

cheers, gryff :slight_smile:

2 Likes

Thank you very much. In conclusion, I set the mesh “Shape key” in blender and carried it in the exported Babylon file. How do I use and call it?I used a "new BABYLON. MorphTargetManager ();"But it doesn’t seem right, right?

Thank you very much :笑脸: