assetsManager.onTaskSuccessObservable.add(async (task) => {
var mainMesh = task.loadedMeshes[0];
mainMesh.position.x = 0;
mainMesh.position.y = 1.25;
mainMesh.scaling.set(0.1,0.1,0.1);
console.log("PREPARING FOR OPTI")
await mainMesh.optimizeIndices(async () => {
await mainMesh.simplify([{distance:40, quality:0.2}], false, BABYLON.SimplificationType.QUADRATIC, function() {
alert("simplification finished");
});
})
Using assets manager to load external stl mesh. everything is working as expected. I then attempt to use optimize indices and simplify and never see the alert. I’ve tried adding awaits, but don’t see any result. poly count remains the same in the debugger. How do I apply these simplications to a mesh referenced via a task?
Also, from a previous post, I saw that you can assign distance: undefined to automatically add these simplifications. when I attempted, I got an error. Any ideas?
Thanks in advance