We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Problem with “batch” object import

Home Forums Programming Problem with “batch” object import

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #66903
    David Duperron
    Customer

    Hi!
    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!
    Cheers

    David

    #66904
    David Duperron
    Customer

    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.

    #66905
    kdv
    Participant

    Everything looks like the for loop goes “quicker” than the import process

    Much-much quicker, ~0-1 ms for all iterations.

    You may want to use a looped procedure for async functions to start the next iteration right after the previous one has been finished. Something like this

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #66908
    David Duperron
    Customer

    Hi @kdv77kdv!
    Thanks again for your expertise… I will try this right after lunch, and I’m pretty sure that once again this will save my day! ;)
    Cheers

    David

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.