fix: #36060 Collada Import: animated armature+mesh problem

This commit is contained in:
Gaia Clary 2013-07-14 17:21:12 +00:00
parent 4507dd9a7e
commit e353593b30
3 changed files with 9 additions and 16 deletions

@ -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;
}
}

@ -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);

@ -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.