[Bf-blender-cvs] [75f1fb6d862] blender2.8: Depsgraph: Fix crash on undo of new bone added

Sergey Sharybin noreply at git.blender.org
Tue Jul 31 11:39:36 CEST 2018


Commit: 75f1fb6d86225c9b764f3909e83accc07685b009
Author: Sergey Sharybin
Date:   Tue Jul 31 11:32:38 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB75f1fb6d86225c9b764f3909e83accc07685b009

Depsgraph: Fix crash on undo of new bone added

Pose is not brought up to date for until exit of edit mode,
so can not use.

===================================================================

M	source/blender/blenkernel/intern/armature_update.c
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index 26fbd22c67e..03d370f6e7c 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -688,7 +688,8 @@ void BKE_pose_bone_done(struct Depsgraph *depsgraph,
 		invert_m4_m4(imat, pchan->bone->arm_mat);
 		mul_m4_m4m4(pchan->chan_mat, pchan->pose_mat, imat);
 	}
-	if (DEG_is_active(depsgraph)) {
+	bArmature *arm = (bArmature *)ob->data;
+	if (DEG_is_active(depsgraph) && arm->edbo == NULL) {
 		bPoseChannel *pchan_orig = pchan->orig_pchan;
 		copy_m4_m4(pchan_orig->pose_mat, pchan->pose_mat);
 		copy_m4_m4(pchan_orig->chan_mat, pchan->chan_mat);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index ee814e11d40..22c1167de2a 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -548,9 +548,13 @@ void update_special_pointers(const Depsgraph *depsgraph,
 				object_cow->runtime.mesh_orig = (Mesh *)object_cow->data;
 			}
 			if (object_cow->type == OB_ARMATURE) {
-				BKE_pose_remap_bone_pointers((bArmature *)object_cow->data,
-				                             object_cow->pose);
-				update_pose_orig_pointers(object_orig->pose, object_cow->pose);
+				const bArmature *armature_orig = (bArmature *)object_orig->data;
+				bArmature *armature_cow = (bArmature *)object_cow->data;
+				BKE_pose_remap_bone_pointers(armature_cow, object_cow->pose);
+				if (armature_orig->edbo == NULL) {
+					update_pose_orig_pointers(object_orig->pose,
+					                          object_cow->pose);
+				}
 			}
 			update_particle_system_orig_pointers(object_orig, object_cow);
 			break;



More information about the Bf-blender-cvs mailing list