Fix: Collada Import of armatures only added the root bone
authorGaia Clary <gaia.clary@machinimatrix.org>
Mon, 11 Feb 2013 20:21:10 +0000 (20:21 +0000)
committerGaia Clary <gaia.clary@machinimatrix.org>
Mon, 11 Feb 2013 20:21:10 +0000 (20:21 +0000)
source/blender/collada/DocumentImporter.cpp

index 88a67eebe9dc2831843a4da2b227d48117411505..52dd587231d9348b78451d5ab8e1611425162b13 100644 (file)
@@ -583,11 +583,16 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLA
        }
        // if node has child nodes write them
        COLLADAFW::NodePointerArray &child_nodes = node->getChildNodes();
+
        if (objects_done->size() > 0) {
                ob = *objects_done->begin();
-               for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
-                       write_node(child_nodes[i], node, sce, ob, is_library_node);
-               }
+       }
+       else {
+               ob = NULL;
+       }
+
+       for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
+               write_node(child_nodes[i], node, sce, ob, is_library_node);
        }
 
        return objects_done;