Fix #124702: crash when pasting material

This commit is contained in:
Jacques Lucke
2024-08-02 11:07:17 +02:00
parent 1a266f6894
commit c90f13f2b3

View File

@@ -52,6 +52,7 @@
#include "BKE_main.hh"
#include "BKE_material.h"
#include "BKE_node.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_object.hh"
#include "BKE_report.hh"
@@ -2833,6 +2834,10 @@ static int paste_material_exec(bContext *C, wmOperator *op)
* Always call instead of checking when it *might* be needed. */
DEG_relations_tag_update(bmain);
/* There are some custom updates to the node tree above, better do a full update pass. */
BKE_ntree_update_tag_all(ma->nodetree);
ED_node_tree_propagate_change(C, bmain, nullptr);
DEG_id_tag_update(&ma->id, ID_RECALC_SYNC_TO_EVAL);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma);