[Bf-blender-cvs] [4d04a345a61] master: Cleanup: Move notifiers to `move_to_index` functions

Nathan Craddock noreply at git.blender.org
Tue Sep 15 23:35:59 CEST 2020


Commit: 4d04a345a618165f587ab7e5f396f92a13c5731a
Author: Nathan Craddock
Date:   Tue Sep 15 15:01:49 2020 -0600
Branches: master
https://developer.blender.org/rB4d04a345a618165f587ab7e5f396f92a13c5731a

Cleanup: Move notifiers to `move_to_index` functions

Move the notifiers and DEG tagging to the ED_* level functions for
modifiers and gpencil shaderfx in preparation for outliner modifier and
shaderfx drag and drop. No functional changes.

Differential Revision: https://developer.blender.org/D8642

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

M	source/blender/editors/object/object_gpencil_modifier.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_shader_fx.c

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

diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c
index 575ef38476c..e9b430ee54b 100644
--- a/source/blender/editors/object/object_gpencil_modifier.c
+++ b/source/blender/editors/object/object_gpencil_modifier.c
@@ -228,6 +228,9 @@ bool ED_object_gpencil_modifier_move_to_index(ReportList *reports,
     }
   }
 
+  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+  WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
+
   return true;
 }
 
@@ -674,9 +677,6 @@ static int gpencil_modifier_move_to_index_exec(bContext *C, wmOperator *op)
     return OPERATOR_CANCELLED;
   }
 
-  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
-  WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
-
   return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 74d6a48c4bf..99644c8f233 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -510,6 +510,9 @@ bool ED_object_modifier_move_to_index(ReportList *reports,
     }
   }
 
+  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+  WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob);
+
   return true;
 }
 
@@ -1300,9 +1303,6 @@ static int modifier_move_to_index_exec(bContext *C, wmOperator *op)
     return OPERATOR_CANCELLED;
   }
 
-  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
-  WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
-
   return OPERATOR_FINISHED;
 }
 
diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c
index 2dbde095e39..c5caee5ba08 100644
--- a/source/blender/editors/object/object_shader_fx.c
+++ b/source/blender/editors/object/object_shader_fx.c
@@ -235,6 +235,9 @@ bool ED_object_shaderfx_move_to_index(ReportList *reports,
     }
   }
 
+  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+  WM_main_add_notifier(NC_OBJECT | ND_SHADERFX, ob);
+
   return true;
 }
 
@@ -607,9 +610,6 @@ static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op)
     return OPERATOR_CANCELLED;
   }
 
-  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
-  WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob);
-
   return OPERATOR_FINISHED;
 }



More information about the Bf-blender-cvs mailing list