[Bf-blender-cvs] [c64c901535] master: fix D2489: Collada exporter broke edit data when exporting Armature while in Armature edit mode
Gaia Clary
noreply at git.blender.org
Sat Jan 28 21:51:55 CET 2017
Commit: c64c901535505db3087b621b7d2ccf14a28c2683
Author: Gaia Clary
Date: Sat Jan 28 21:51:18 2017 +0100
Branches: master
https://developer.blender.org/rBc64c901535505db3087b621b7d2ccf14a28c2683
fix D2489: Collada exporter broke edit data when exporting Armature while in Armature edit mode
===================================================================
M source/blender/collada/ArmatureExporter.cpp
===================================================================
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 4f5cf83f5c..35cf7dd762 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -69,7 +69,10 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce,
// write bone nodes
bArmature * armature = (bArmature *)ob_arm->data;
- ED_armature_to_edit(armature);
+ bool is_edited = armature->edbo != NULL;
+
+ if (!is_edited)
+ ED_armature_to_edit(armature);
bArmature *arm = (bArmature *)ob_arm->data;
for (Bone *bone = (Bone *)arm->bonebase.first; bone; bone = bone->next) {
@@ -78,8 +81,10 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce,
add_bone_node(bone, ob_arm, sce, se, child_objects);
}
- ED_armature_from_edit(armature);
- ED_armature_edit_free(armature);
+ if (!is_edited) {
+ ED_armature_from_edit(armature);
+ ED_armature_edit_free(armature);
+ }
}
void ArmatureExporter::write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone)
More information about the Bf-blender-cvs
mailing list