Fix missing Outliner updates when adding nodetrees
When e.g. grouping nodes into nodegroups, these would not show up immediately in the Outliner (Blender File / Data API view). Now send (unique combination, not used elsewhere) notifiers (and listen for these in the Outliner). Differential Revision: https://developer.blender.org/D16093
This commit is contained in:
parent
2004827bc9
commit
8ba508d70b
Notes:
blender-bot
2023-02-14 11:29:52 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
|
@ -997,6 +997,7 @@ static int surface_set_exec(bContext *C, wmOperator *op)
|
|||
|
||||
DEG_id_tag_update(&curves_ob.id, ID_RECALC_TRANSFORM);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, &curves_id);
|
||||
WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
|
||||
|
||||
/* Required for deformation. */
|
||||
new_surface_ob.modifier_flag |= OB_MODIFIER_FLAG_ADD_REST_POSITION;
|
||||
|
|
|
@ -777,6 +777,8 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
|
|||
ED_node_tree_update(C);
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
|
|
@ -1047,6 +1047,8 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
|
|||
|
||||
ED_node_tree_propagate_change(C, bmain, nullptr);
|
||||
|
||||
WM_event_add_notifier(C, NC_NODE | NA_ADDED, NULL);
|
||||
|
||||
/* We broke relations in node tree, need to rebuild them in the graphs. */
|
||||
DEG_relations_tag_update(bmain);
|
||||
|
||||
|
|
|
@ -256,6 +256,12 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params)
|
|||
ED_region_tag_redraw(region);
|
||||
}
|
||||
break;
|
||||
case NC_NODE:
|
||||
if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) &&
|
||||
ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API)) {
|
||||
ED_region_tag_redraw(region);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue