[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54678] trunk/blender/source/blender/ collada/DocumentImporter.cpp: fix #34049: Collada importer doesn' t import armature.
Gaia Clary
gaia.clary at machinimatrix.org
Wed Feb 20 01:13:35 CET 2013
Revision: 54678
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54678
Author: gaiaclary
Date: 2013-02-20 00:13:34 +0000 (Wed, 20 Feb 2013)
Log Message:
-----------
fix #34049: Collada importer doesn't import armature. Added some comments to the program code for better understanding.
Modified Paths:
--------------
trunk/blender/source/blender/collada/DocumentImporter.cpp
Modified: trunk/blender/source/blender/collada/DocumentImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-02-20 00:06:31 UTC (rev 54677)
+++ trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-02-20 00:13:34 UTC (rev 54678)
@@ -319,6 +319,9 @@
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 @@
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 @@
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;
}
}
More information about the Bf-blender-cvs
mailing list