Character creator with Mesh MorphTarget

Hello Fellow Monkeys!

I’m not clear about MorphTarget on the Mesh class. I’ve tried the TestMorph test where there are three cubes and a plane changes it’s position by pressing the ZUIJ keys.

I want to make a character creator. For simplicity let’s say I have a normal version and a fat version of the same character model. With the MorphTarget on the Mesh, I would be able to implement a slider so the character would look normal, fat or anywhere inbetween based on the selected value on the slider, right? It’s the correct use-case for MorphTargets, right?

I think MorphTargets is for blendShapes in Blender
You can setup blendshapes in blender for example morphing between slim → fat then in jme you can use like this

myGeom.addControl(new MorphControl());
float[] weights = myGeom.getMorphState(); // array of blend shapes
weights[26] = 0.5f; // choose the blend shapes and add the influence weight 0.0 -> 1.0
myGeom.setMorphState(weights);
1 Like

Thank you for your answer! I’ve made an example app and it works perfectly with animations and blend shape keys. I originally assembled it by hand, meaning I’ve made two models and in code added morph targets but it did not work correctly.

1 Like