[Bf-blender-cvs] [94a63f75055] master: Fix T80945: Build modifier not updating after outliner copy

Nathan Craddock noreply at git.blender.org
Sun Sep 20 00:34:34 CEST 2020


Commit: 94a63f75055024dbf0c9f9236b3cda5438fa2162
Author: Nathan Craddock
Date:   Sat Sep 19 16:27:56 2020 -0600
Branches: master
https://developer.blender.org/rB94a63f75055024dbf0c9f9236b3cda5438fa2162

Fix T80945: Build modifier not updating after outliner copy

Build modifiers linked or copied to objects from the outliner would not
animate until the file was saved and reopened due to a missing depsgraph
relations tag.

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

M	source/blender/editors/include/ED_object.h
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/space_outliner/outliner_dragdrop.c

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

diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 45e23cadaaa..6fdd65fdcc9 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -430,7 +430,8 @@ int ED_object_modifier_copy(struct ReportList *reports,
                             struct Object *ob,
                             struct ModifierData *md);
 void ED_object_modifier_link(struct bContext *C, struct Object *ob_dst, struct Object *ob_src);
-void ED_object_modifier_copy_to_object(struct Object *ob_dst,
+void ED_object_modifier_copy_to_object(struct bContext *C,
+                                       struct Object *ob_dst,
                                        struct Object *ob_src,
                                        struct ModifierData *md);
 
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 370667391c5..8f5fa6b7834 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -521,13 +521,22 @@ void ED_object_modifier_link(bContext *C, Object *ob_dst, Object *ob_src)
   BKE_object_link_modifiers(ob_dst, ob_src);
   WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob_dst);
   DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
+
+  Main *bmain = CTX_data_main(C);
+  DEG_relations_tag_update(bmain);
 }
 
-void ED_object_modifier_copy_to_object(Object *ob_dst, Object *ob_src, ModifierData *md)
+void ED_object_modifier_copy_to_object(bContext *C,
+                                       Object *ob_dst,
+                                       Object *ob_src,
+                                       ModifierData *md)
 {
   BKE_object_copy_modifier(ob_dst, ob_src, md);
   WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob_dst);
   DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
+
+  Main *bmain = CTX_data_main(C);
+  DEG_relations_tag_update(bmain);
 }
 
 bool ED_object_modifier_convert(ReportList *UNUSED(reports),
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 58f6f82c80d..302d606e4c8 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -964,7 +964,7 @@ static void datastack_drop_copy(bContext *C, StackDropData *drop_data)
       }
       else if (drop_data->ob_parent->type != OB_GPENCIL && ob_dst->type != OB_GPENCIL) {
         ED_object_modifier_copy_to_object(
-            ob_dst, drop_data->ob_parent, drop_data->drag_directdata);
+            C, ob_dst, drop_data->ob_parent, drop_data->drag_directdata);
       }
       break;
     case TSE_CONSTRAINT:



More information about the Bf-blender-cvs mailing list