diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-02-20 04:13:34 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-02-20 04:13:34 +0400 |
commit | 7337c2d4c2a84b7a0b3e212d76aa2e3b6fca8f9a (patch) | |
tree | 197e0a371f790857677497901ef120dc8851b2b0 /source/blender/collada/DocumentImporter.cpp | |
parent | 134537b65baf7fead290f37ae875801fe0784b34 (diff) |
fix #34049: Collada importer doesn't import armature. Added some comments to the program code for better understanding.
Diffstat (limited to 'source/blender/collada/DocumentImporter.cpp')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 1b726192079..17a1c7f1e18 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -319,6 +319,9 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW anim_importer.translate_Animations(node, root_map, object_map, FW_object_map); if (node->getType() == COLLADAFW::Node::JOINT && par == NULL) { + // For Skeletons without root node we have to simulate the + // root node here and recursively enter the same function + // XXX: maybe this can be made more elegant. translate_anim_recursive(node, node, parob); } else { @@ -473,8 +476,9 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLA if (is_joint) { if (parent_node == NULL) { + // A Joint on root level is a skeleton without root node. + // Here we add the armature "on the fly": par = bc_add_object(sce, OB_ARMATURE, std::string("Armature").c_str()); - //anim_importer.read_node_transform(node, par); objects_done->push_back(par); object_map.insert(std::make_pair<COLLADAFW::UniqueId, Object *>(node->getUniqueId(), par)); node_map[node->getUniqueId()] = node; @@ -482,6 +486,8 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLA armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par, sce); if (parent_node == NULL) { + // for skeletons without root node all has been done above. + // Skeletons with root node are handled further down. return objects_done; } } |