[Bf-blender-cvs] [6247b8cc771] blender-v2.92-release: Fix T85722: missing updates adding modifiers via python

Philipp Oeser noreply at git.blender.org
Wed Feb 17 15:59:06 CET 2021


Commit: 6247b8cc77131ec52501ec8585e9f3de6056a746
Author: Philipp Oeser
Date:   Wed Feb 17 15:09:05 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rB6247b8cc77131ec52501ec8585e9f3de6056a746

Fix T85722: missing updates adding modifiers via python

Was reported for Geometry Nodes Editor "New" button, but was true for
any modifier added via modifiers.new().

Now just add appropriate nofifier.

Maniphest Tasks: T85722

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

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

M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index faa20e642cf..6e534868120 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1600,7 +1600,12 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
 static ModifierData *rna_Object_modifier_new(
     Object *object, bContext *C, ReportList *reports, const char *name, int type)
 {
-  return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
+  ModifierData *md = ED_object_modifier_add(
+      reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
+
+  WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_ADDED, object);
+
+  return md;
 }
 
 static void rna_Object_modifier_remove(Object *object,



More information about the Bf-blender-cvs mailing list