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:
authorArystanbek Dyussenov <arystan.d@gmail.com>2012-03-04 17:43:23 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2012-03-04 17:43:23 +0400
commitc2760307e853e88fb61be24b7cc3db03d6d2219b (patch)
tree78cbc7d90ec24eabc897dba1dd05acbcc587c026 /source/blender/collada
parent12d0489b33a16d2aca32d5d734a3c433a730eb54 (diff)
#collada skeleton import, bugfix #29621
Do not crash when joint SIDs cannot be resolved. OpenCOLLADA cannot resolve joint SIDs connected to skin if the <skeleton> tag is missing. Page 148 of COLLADA spec 1.4.1 states: "<skeleton> elements define where to start the sid lookup". So I think this is a bug in "FBX COLLADA exporter" which did not add the <skeleton> tag. The problem can be fixed by manually adding the <skeleton> tag into <instance_controller>.
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 4bc0c18551a..11a48fd3cfd 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -410,12 +410,16 @@ void ArmatureImporter::create_armature_bones( )
std::vector<COLLADAFW::Node*>::iterator ri;
//if there is an armature created for root_joint next root_joint
for (ri = root_joints.begin(); ri != root_joints.end(); ri++) {
- if ( get_armature_for_joint(*ri) != NULL ) continue;
+ if ( get_armature_for_joint(*ri) != NULL ) continue;
//add armature object for current joint
//Object *ob_arm = add_object(scene, OB_ARMATURE);
Object *ob_arm = joint_parent_map[(*ri)->getUniqueId()];
+
+ if (!ob_arm)
+ continue;
+
//ob_arm->type = OB_ARMATURE;
ED_armature_to_edit(ob_arm);
@@ -423,24 +427,24 @@ void ArmatureImporter::create_armature_bones( )
// create unskinned bones
/*
- TODO:
- check if bones have already been created for a given joint
+ TODO:
+ check if bones have already been created for a given joint
*/
leaf_bone_length = FLT_MAX;
create_unskinned_bone(*ri, NULL, (*ri)->getChildNodes().getCount(), NULL, ob_arm);
fix_leaf_bones();
- // exit armature edit mode
+ // exit armature edit mode
- unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
+ unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
- ED_armature_from_edit(ob_arm);
+ ED_armature_from_edit(ob_arm);
- set_pose(ob_arm , *ri, NULL, NULL );
+ set_pose(ob_arm , *ri, NULL, NULL );
- ED_armature_edit_free(ob_arm);
- DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
+ ED_armature_edit_free(ob_arm);
+ DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
}