[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58242] trunk/blender/source/blender/ collada: fix: #36060 Collada Import: animated armature+mesh problem
Gaia Clary
gaia.clary at machinimatrix.org
Sun Jul 14 19:21:13 CEST 2013
Revision: 58242
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58242
Author: gaiaclary
Date: 2013-07-14 17:21:12 +0000 (Sun, 14 Jul 2013)
Log Message:
-----------
fix: #36060 Collada Import: animated armature+mesh problem
Modified Paths:
--------------
trunk/blender/source/blender/collada/ArmatureImporter.cpp
trunk/blender/source/blender/collada/ArmatureImporter.h
trunk/blender/source/blender/collada/DocumentImporter.cpp
Modified: trunk/blender/source/blender/collada/ArmatureImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/ArmatureImporter.cpp 2013-07-14 16:54:20 UTC (rev 58241)
+++ trunk/blender/source/blender/collada/ArmatureImporter.cpp 2013-07-14 17:21:12 UTC (rev 58242)
@@ -166,7 +166,7 @@
}
bone->length = len_v3v3(bone->head, bone->tail);
-
+ joint_by_uid[node->getUniqueId()] = node;
finished_joints.push_back(node);
}
@@ -517,16 +517,11 @@
// root - if this joint is the top joint in hierarchy, if a joint
// is a child of a node (not joint), root should be true since
// this is where we build armature bones from
-void ArmatureImporter::add_joint(COLLADAFW::Node *node, bool root, Object *parent)
+void ArmatureImporter::add_root_joint(COLLADAFW::Node *node, Object *parent)
{
- joint_by_uid[node->getUniqueId()] = node;
- if (root) {
- root_joints.push_back(node);
-
- if (parent) {
-
- joint_parent_map[node->getUniqueId()] = parent;
- }
+ root_joints.push_back(node);
+ if (parent) {
+ joint_parent_map[node->getUniqueId()] = parent;
}
}
Modified: trunk/blender/source/blender/collada/ArmatureImporter.h
===================================================================
--- trunk/blender/source/blender/collada/ArmatureImporter.h 2013-07-14 16:54:20 UTC (rev 58241)
+++ trunk/blender/source/blender/collada/ArmatureImporter.h 2013-07-14 17:21:12 UTC (rev 58242)
@@ -140,12 +140,8 @@
ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, Scene *sce);
~ArmatureImporter();
- void add_joint(COLLADAFW::Node *node, bool root, Object *parent);
+ void add_root_joint(COLLADAFW::Node *node, Object *parent);
-#if 0
- void add_root_joint(COLLADAFW::Node *node);
-#endif
-
// here we add bones to armatures, having armatures previously created in write_controller
void make_armatures(bContext *C);
Modified: trunk/blender/source/blender/collada/DocumentImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-07-14 16:54:20 UTC (rev 58241)
+++ trunk/blender/source/blender/collada/DocumentImporter.cpp 2013-07-14 17:21:12 UTC (rev 58242)
@@ -480,7 +480,9 @@
object_map.insert(std::pair<COLLADAFW::UniqueId, Object *>(node->getUniqueId(), par));
node_map[node->getUniqueId()] = node;
}
- armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par);
+ if (parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT) {
+ armature_importer.add_root_joint(node, par);
+ }
if (parent_node == NULL) {
// for skeletons without root node all has been done above.
More information about the Bf-blender-cvs
mailing list