Good Afternoon all!
I was looking at this playground I found, showing a small version of the drag and drop files capability of the babylonjs sandbox.
So my question is this: How can I get an array of meshes from the file that was dragged and dropped and loaded into the playground based on a mesh’s total vertices? When loading files with the AssetsManager, I would rely on taskmanager, like so:
var assetsManager = new BABYLON.AssetsManager(scene);
meshTask = assetsManager.addMeshTask("mtask", "", modelpath, modelname + ".obj");
assetsManager.load();
meshTask.onSuccess = function (task) {
let ms = task.loadedMeshes.filter(function (mesh) {
return mesh.geometry._totalVertices > 0; // this line fails
});
meshes = ms;
});
How do I get the meshes? I tried using
currentScene.meshes(x).geometry._totalVertices
but I error out.
Thanks for the assistance!