From 39a5dc3edd0f7e1895bde36fff579af6956efbca Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 13 Feb 2025 16:37:52 +0100 Subject: [PATCH] Fix #134430: missing node tree update after copying data-block There was a missing call to `BKE_main_ensure_invariants` to make sure that the node tree is in the expected state. I'm passing the `newid` to the function so that it can skip iterating over all of `Main` in the majority of cases. Pull Request: https://projects.blender.org/blender/blender/pulls/134446 --- source/blender/makesrna/intern/rna_ID.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/makesrna/intern/rna_ID.cc b/source/blender/makesrna/intern/rna_ID.cc index 31018afde5f..e93acc516ea 100644 --- a/source/blender/makesrna/intern/rna_ID.cc +++ b/source/blender/makesrna/intern/rna_ID.cc @@ -219,6 +219,7 @@ const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = { # include "BKE_lib_query.hh" # include "BKE_lib_remap.hh" # include "BKE_library.hh" +# include "BKE_main_invariants.hh" # include "BKE_material.hh" # include "BKE_preview_image.hh" # include "BKE_vfont.hh" @@ -714,6 +715,7 @@ static ID *rna_ID_copy(ID *id, Main *bmain) } WM_main_add_notifier(NC_ID | NA_ADDED, nullptr); + BKE_main_ensure_invariants(*bmain, *newid); return newid; }