From d40671a154211cdfae15c576c93e17af93643bbd Mon Sep 17 00:00:00 2001 From: Guillermo Venegas Date: Fri, 26 Apr 2024 13:41:46 -0600 Subject: [PATCH 1/2] fix anim --- source/blender/editors/space_node/node_add.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index 529ed7c16d6..da3155cf4c2 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -726,6 +726,18 @@ static int node_add_file_modal(bContext *C, wmOperator *op, const wmEvent *event /* End stack animation. */ if (duration > node_stack_anim_duration) { WM_event_timer_remove(CTX_wm_manager(C), nullptr, data->anim_timer); + /* Enable back node previews. Only enabled by default to compositor nodes. */ + SpaceNode &snode = *CTX_wm_space_node(C); + bNodeTree &node_tree = *snode.edittree; + if (node_tree.type == NTREE_COMPOSIT) { + for (bNode *node : data->nodes) { + if (node_is_previewable(snode, node_tree, *node)) { + node->flag |= NODE_PREVIEW; + } + } + Main *bmain = CTX_data_main(C); + ED_node_tree_propagate_change(C, bmain, &node_tree); + } MEM_delete(data); op->customdata = nullptr; return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH); @@ -811,6 +823,10 @@ static int node_add_file_exec(bContext *C, wmOperator *op) node_deselect_all(node_tree); for (bNode *node : nodes) { nodeSetSelected(node, true); + /* Temporarily disable node preview for smoother stack animation. */ + if (nodes.size() > 1 && node_is_previewable(snode, node_tree, *node)) { + node->flag &= ~NODE_PREVIEW; + } } ED_node_set_active(bmain, &snode, &node_tree, nodes[0], nullptr); -- 2.30.2 From 9bb55b454dd3b947b77ec13949cb574b3b90e5e0 Mon Sep 17 00:00:00 2001 From: Guillermo Venegas Date: Fri, 26 Apr 2024 14:11:05 -0600 Subject: [PATCH 2/2] grammar --- source/blender/editors/space_node/node_add.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index da3155cf4c2..32d65b78ee6 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -726,7 +726,7 @@ static int node_add_file_modal(bContext *C, wmOperator *op, const wmEvent *event /* End stack animation. */ if (duration > node_stack_anim_duration) { WM_event_timer_remove(CTX_wm_manager(C), nullptr, data->anim_timer); - /* Enable back node previews. Only enabled by default to compositor nodes. */ + /* Reenable node previews. Only enabled by default in compositor nodes. */ SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; if (node_tree.type == NTREE_COMPOSIT) { -- 2.30.2