Hey,
what are circumstances in which
assetsManager.loadAsync()
may not work?
I am really puzzled since the promise i get when calling this method has state “Pending” forever and none of the “then” handlers are triggered.
The assetsManager.load() works like a charm though.
Here’s the code:
187 addTask(name, meshSubdir) {
188 let self = this;
189 let load_path = DATA_FILES + "/" + meshSubdir + "/";
190 let meshTask = this.assetsManager.addMeshTask("task_" + name, "", load_path, name + '.babylon');
191 this.tasks[name] = meshTask;
192
193
194 meshTask.onSuccess = function (task) {
195 const scale = MESH_SCALING[meshSubdir];
196 let loadedMesh = meshTask.loadedMeshes[0]
197 loadedMesh.scaling = new BABYLON.Vector3(scale, scale, scale)
198 loadedMesh.isVisible = false;
199 self.meshes[name] = loadedMesh;
200 self._recomputeScene();
201 console.log('DEBUG: model:' + name + ' loaded successfully');
202 }
203 meshTask.onError = function (task, message, exception) {
204 console.log('EXCEPTION: Mesh with name ' + name + ' not loaded:', message, exception)
205 }
206
207 console.log('DEBUG: Added ' + meshTask.name + ' to task asset manager' );
208 let promise = this.assetsManager.loadAsync();
209 promise.then(function (tasks) { console.log(tasks)});
210
211 }