I developped a solution that can import obejcts from gltf files, and manipulate them (position/rotation, attach other objects to it, change color, etc…).
Everything works fine when I import one object after the other.
Then I also have a solution to imported saved configurations, and that’s where it starts to bug… I tried to use the same philosophy than for individual imports, and loop through a dictionnary (json) to batch import objects using the “append scene” puzzle.
I have random errors that I suspect are caused by asynchroneous operations that are messing up the various procedures variables, and cause random errors once a few objects have been imported.
How can I make sure that one object is completly imported (a series of procedures have completed nicely for that object) before to move on to the next?
Thanks for any help!
Here is the piece of puzzle:
I would like to make sure that the “addGenericObject” or “addCustomObject” procedures have completed before to move on to the next object in the for loop… Everything looks like the for loop goes “quicker” than the import process, and that cause my procedures to fail (the import seems to import correctly – no “on error” action triggered) but all the stuff that I need to do inside these procedure do not complete.