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
This commit is contained in:
Jacques Lucke
2025-02-13 16:37:52 +01:00
parent 343205a4da
commit 39a5dc3edd

View File

@@ -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;
}