Hi,
I created a model on Blender (2.79b) with a short animation to test.
My model is scaled at 1.00 and all bones at the first frame were reseted (ALT G/S/R).
This model is for a game, so, i need to clone mesh/materials and animation for each player.
I use BabylonJS v4.1.0
First, i exported my model with the “Babylon 5.6.4” plugin. The animation is not correct.
Then, i exported in GLB format (v2). The animation is fine but instead of having 1 mesh, there are a lot of meshes ( root and 10 primitives).
I don’t really see the advantage of having a mesh per material and especially that the .babylon export creates a single mesh.
I need to work with only 1 mesh so i try to merge them into 1 mesh but it gives an error:
BABYLON.SceneLoader.ImportMesh("", path, "ChickenV2.glb", scene, function (newMeshes, particleSystems, newSkeletons) {
var skeleton=newSkeletons[0];
var newMesh=BABYLON.Mesh.MergeMeshes(newMeshes);
newMesh.skeleton=skeleton;
var idleAnim = scene.beginAnimation(skeleton, 0, 50, true);
});
Error: Positions are required
at e._validate (babylon.js:16)
at e.merge (babylon.js:16)
at Function.t.MergeMeshes (babylon.js:16)
at charactere2:252
at p (babylon.js:16)
at babylon.js:16
If i set “multiMultiMaterials” option, i get an other type of error.
var newMesh=BABYLON.Mesh.MergeMeshes(newMeshes, undefined, undefined, undefined, undefined, true);
TypeError: Cannot read property 'length' of undefined
at Function.t.MergeMeshes (babylon.js:16)
at charactere2:254
at p (babylon.js:16)
at babylon.js:16
How to solve my problem?