[Bf-blender-cvs] [6183688c356] blender-v2.81-release: Fix T70919: Proxies crash after building motion path

Sergey Sharybin noreply at git.blender.org
Fri Oct 18 16:09:25 CEST 2019


Commit: 6183688c3560100dc1dcce3354cb622a135bc275
Author: Sergey Sharybin
Date:   Fri Oct 18 15:42:45 2019 +0200
Branches: blender-v2.81-release
https://developer.blender.org/rB6183688c3560100dc1dcce3354cb622a135bc275

Fix T70919: Proxies crash after building motion path

Was cause by recent fix for T65134 which assigned original object's
proxy_from to an evaluated pointer.

This is because motion path depsgraph does not include proxies, so
the pointer in an evaluated object was kept pointing to an original
object.

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

M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

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

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 1f9c12f604d..73a0823f84b 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
@@ -755,6 +755,25 @@ void update_animation_data_after_copy(const ID *id_orig, ID *id_cow)
   update_nla_tracks_orig_pointers(&anim_data_orig->nla_tracks, &anim_data_cow->nla_tracks);
 }
 
+/* Some builders (like motion path one) will ignore proxies from being built. This code makes it so
+ * proxy and proxy_group pointers never point to an original objects, preventing evaluation code
+ * from assign evaluated pointer to an original proxy->proxy_from. */
+void update_proxy_pointers_after_copy(const Depsgraph * /*depsgraph*/,
+                                      const Object * /*object_orig*/,
+                                      Object *object_cow)
+{
+  if (object_cow->proxy != NULL) {
+    if ((object_cow->proxy->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0) {
+      object_cow->proxy = NULL;
+    }
+  }
+  if (object_cow->proxy_group != NULL) {
+    if ((object_cow->proxy_group->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0) {
+      object_cow->proxy_group = NULL;
+    }
+  }
+}
+
 /* Do some special treatment of data transfer from original ID to it's
  * CoW complementary part.
  *
@@ -788,6 +807,7 @@ void update_id_after_copy(const Depsgraph *depsgraph,
       }
       update_particles_after_copy(depsgraph, object_orig, object_cow);
       update_modifiers_orig_pointers(object_orig, object_cow);
+      update_proxy_pointers_after_copy(depsgraph, object_orig, object_cow);
       break;
     }
     case ID_SCE: {



More information about the Bf-blender-cvs mailing list