Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-07-14 21:21:12 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-07-14 21:21:12 +0400
commite353593b30092563a2f140a7709bb425cd69fddf (patch)
tree2137bdea7357a04eebcb593ca14689bc72da01b8 /source/blender
parent4507dd9a7e0b1980ac7fb2e0a26a460fd62671e6 (diff)
fix: #36060 Collada Import: animated armature+mesh problem
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp15
-rw-r--r--source/blender/collada/ArmatureImporter.h6
-rw-r--r--source/blender/collada/DocumentImporter.cpp4
3 files changed, 9 insertions, 16 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 121e4d1d605..0cd48707566 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -166,7 +166,7 @@ void ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBo
}
bone->length = len_v3v3(bone->head, bone->tail);
-
+ joint_by_uid[node->getUniqueId()] = node;
finished_joints.push_back(node);
}
@@ -517,16 +517,11 @@ void ArmatureImporter::set_pose(Object *ob_arm, COLLADAFW::Node *root_node, con
// 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;
}
}
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index bd17a925f3a..beeac85cc4d 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -140,11 +140,7 @@ public:
ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, Scene *sce);
~ArmatureImporter();
- void add_joint(COLLADAFW::Node *node, bool root, Object *parent);
-
-#if 0
- void add_root_joint(COLLADAFW::Node *node);
-#endif
+ void add_root_joint(COLLADAFW::Node *node, Object *parent);
// here we add bones to armatures, having armatures previously created in write_controller
void make_armatures(bContext *C);
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index af1113b337a..60ef69379de 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -480,7 +480,9 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node, COLLA
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.