Merge with trunk r37677
[blender.git] / source / blender / collada / DocumentImporter.cpp
index 78ee444..14ce9a9 100644 (file)
@@ -250,12 +250,13 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
        unsigned int i;
        Object *ob;
 
-       for (i = 0; i < 4; i++)
-               ob = anim_importer.translate_animation(node, object_map, root_map, types[i]);
+       //for (i = 0; i < 4; i++)
+               //ob = 
+       anim_importer.translate_Animations_NEW(node, root_map, object_map);
 
        COLLADAFW::NodePointerArray &children = node->getChildNodes();
        for (i = 0; i < children.getCount(); i++) {
-               translate_anim_recursive(children[i], node, ob);
+               translate_anim_recursive(children[i], node, NULL);
        }
 }
 
@@ -382,7 +383,14 @@ void DocumentImporter::write_node (COLLADAFW::Node *node, COLLADAFW::Node *paren
        bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
 
        if (is_joint) {
-               armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par);
+               if ( par ) {
+               Object * empty = par;
+               par = add_object(sce, OB_ARMATURE);
+               bc_set_parent(par,empty->parent, mContext);
+               //remove empty : todo
+               object_map[parent_node->getUniqueId()] = par;
+               }
+               armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par, sce);
        }
        else {
                COLLADAFW::InstanceGeometryPointerArray &geom = node->getInstanceGeometries();