[Bf-blender-cvs] [a915e47ca17] master: Fix (unreported) Outliner missing updates copying IDs via python

Philipp Oeser noreply at git.blender.org
Wed Mar 3 08:58:30 CET 2021


Commit: a915e47ca17d6f4949088137f5d39dcb4f582cd2
Author: Philipp Oeser
Date:   Tue Mar 2 18:40:42 2021 +0100
Branches: master
https://developer.blender.org/rBa915e47ca17d6f4949088137f5d39dcb4f582cd2

Fix (unreported) Outliner missing updates copying IDs via python

Steps to reproduce:
- switch to Scripting workspace
- execute bpy.data.meshes['Cube'].copy()
- Outliner will not show the new mesh immediately

Now just send appropriate notifier.

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

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

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

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

diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index fd19352a9a5..6e2005b7314 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -528,6 +528,9 @@ static ID *rna_ID_copy(ID *id, Main *bmain)
   if (newid != NULL) {
     id_us_min(newid);
   }
+
+  WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
+
   return newid;
 }



More information about the Bf-blender-cvs mailing list