GLTFLoader needs to update into an array that's being while-looped over.. it uses the incorrect item :(

i have some threejs code that’s to be the basis for a web based 3D file & data explorer app.

however, upon initializing the data i’ve hit a snag.

at nicerapp_v2/na3D.source.js at 493fe2e1eed5316681d17177e99b99920978093d · nicerapp/nicerapp_v2 · GitHub , i initialize a bunch of filesystem data recursively (data is viewable at nicerapp_v2/backgrounds_recursive.json at 493fe2e1eed5316681d17177e99b99920978093d · nicerapp/nicerapp_v2 · GitHub ), with the intent of creating one folder GLTF (webGL) icon per folder in the dataset.

at both debugger statements, the data in my browser debugger shows correctly.

BUT… inside the t.loader.load() call’s callback for a successful load, i get only the last ‘it’ variable, and the same for each of the GLTF load calls on any given level.

i’ve tried passing the ‘it’ (that’s short for ‘item’, btw) variable as an extra parameter to t.loader.load(), but that just results in ‘it’ being ‘undefined’ when it hits the debugger statement inside the GLTF-load-complete handler.

i’m wondering how to fix this. i’m wondering if i even can at all :frowning:

i dug into the source of threejs and it was fairly easy to adapt, so i did that…


and of course