mrdoob/three.js — pull request #3383 by ZuBsPaCe (2013-04-26 00:54:05+00:00)
Title: Dev fix sceneloader hierarchy

SceneLoader.js did not handle object hierarchies correctly. This pull contains two commits which fix the issue.

Commit 1: The recursive call inside handle_children was only done once after an object was completely loaded. This does not work, if there are asynchronously loaded children. Consequently those were missing in the rendered scene.

Commit 2: counter_models was not updated correctly for models loaded by a HierarchyHandler. The count of children was missing. This lead to a negative number later on. Models loaded afterwards were missing.

I succesfully tested the fix with two modified test_scene.js files which you can get at https://gist.github.com/ZuBsPaCe/5464258 . One of them is based on an example in issue https://github.com/mrdoob/three.js/issues/2276 . Unfortunately I cannot host them myself easily.

This is my first pull request, yay! :) Please tell me if I missed something.

Thank for you for your great project!