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:
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-06-18 00:01:24 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-06-18 00:01:24 +0400
commit3f0e480ba9ebf3f3455ffae30b9d82d1dca8c1bc (patch)
tree25d5449407fac6d2f2e754882ada654c82f39bfd /source/blender/collada/ArmatureImporter.cpp
parentc9b0ce8693ace816e49e157587ebe295dfd9b379 (diff)
unskinned armature import improved but unfinished.
Diffstat (limited to 'source/blender/collada/ArmatureImporter.cpp')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index e64afa1f7b6..6eb03a21d6e 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -383,7 +383,22 @@ void ArmatureImporter::create_armature_bones( )
create_unskinned_bone(*ri, NULL, (*ri)->getChildNodes().getCount(), NULL, (bArmature*)ob_arm->data);
+ fix_leaf_bones();
+
+ // exit armature edit mode
+
+
+ if (joint_parent_map.find((*ri)->getUniqueId()) != joint_parent_map.end() && ob_arm->parent!=NULL)
+ ob_arm->parent = joint_parent_map[(*ri)->getUniqueId()];
+
+ unskinned_armature_map[(*ri)->getUniqueId()] = ob_arm;
+
+ ED_armature_from_edit(ob_arm);
+ ED_armature_edit_free(ob_arm);
+ DAG_id_tag_update(&ob_arm->id, OB_RECALC_OB|OB_RECALC_DATA);
}
+
+
}
void ArmatureImporter::create_armature_bones(SkinInfo& skin)
@@ -558,9 +573,7 @@ void ArmatureImporter::make_armatures(bContext *C)
skin.free();
}
- //if skin_by_data_uid is empty
- if( skin_by_data_uid.empty() )
- create_armature_bones();
+ create_armature_bones();
}
@@ -657,6 +670,11 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node)
return skin.get_armature();
}
+ std::map<COLLADAFW::UniqueId, Object*>::iterator arm;
+ for (arm = unskinned_armature_map.begin(); arm != unskinned_armature_map.end(); arm++) {
+ if(arm->first == node->getUniqueId() )
+ return arm->second;
+ }
return NULL;
}