[Bf-blender-cvs] [c8e775180b3] master: Fix crash when loading a file with existing proxy, and lib has been edited.

Bastien Montagne noreply at git.blender.org
Mon Aug 19 16:48:09 CEST 2019


Commit: c8e775180b3d3ad540b6d5f88e92162b7c93f098
Author: Bastien Montagne
Date:   Mon Aug 19 16:46:31 2019 +0200
Branches: master
https://developer.blender.org/rBc8e775180b3d3ad540b6d5f88e92162b7c93f098

Fix crash when loading a file with existing proxy, and lib has been edited.

Editing a lib char should never, ever be done once you have proxies of
it in your project, that will most certainly break a lot of things...

But at leats let's try no to crash here.

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

M	source/blender/blenkernel/intern/armature_update.c

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

diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index cd1cdce91e0..00975976130 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -887,6 +887,7 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
   }
   BLI_assert(ID_IS_LINKED(object) && object->proxy_from != NULL);
   bPoseChannel *pchan = pose_pchan_get_indexed(object, pchan_index);
+  BLI_assert(pchan != NULL);
   DEG_debug_print_eval_subdata(
       depsgraph, __func__, object->id.name, object, "pchan", pchan->name, pchan);
   /* TODO(sergey): Use indexed lookup, once it's guaranteed to be kept
@@ -897,8 +898,13 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
 #else
   bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name);
 #endif
-  BLI_assert(pchan != NULL);
-  BLI_assert(pchan_from != NULL);
+  if (pchan_from == NULL) {
+    printf(
+        "WARNING: Could not find bone %s in linked ID anymore... "
+        "You should delete and re-generate your proxy.\n",
+        pchan->name);
+    return;
+  }
   BKE_pose_copyesult_pchan_result(pchan, pchan_from);
   copy_dq_dq(&pchan->runtime.deform_dual_quat, &pchan_from->runtime.deform_dual_quat);
   BKE_pchan_bbone_segments_cache_copy(pchan, pchan_from);



More information about the Bf-blender-cvs mailing list