Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

Shouldn't mergeMeshes ignore invalid meshes and continue merging?

$
0
0

Firstly, Congrats for completing 3.2 . We were looking forward to quite of a lot of features implemented here.

This isn't a bug, but in my opinion I think the merge meshes should continue merging the rest of the meshes in the list when it encounters an invalid mesh instead of throwing an error. We have a model load workflow which on load finds the center and extent of the model using mergeMeshes. Few of our models have empty container like meshes that are parent of meshes that have real vertex data. And this breaks our App when vertexData.validate() throws "Positions are required".

There is an easy fix for this - I made a pass before mergingMeshes like so:

for (var i = 0; i < meshes.length; i++) {
//only pass meshes that have valid position data
if (meshes[i].getVerticesData(BABYLON.VertexBuffer.PositionKind))
	clones.push(meshes[i].clone("clone" + i));
}
var combinedMesh = BABYLON.Mesh.MergeMeshes(clones);

This is potentially a breaking change as it works right with 3.1


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>