From 105463e28aa18035dce1bac4e250fd25da9dffeb Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Fri, 24 May 2024 16:22:56 +0200 Subject: [PATCH] GPv3: Change active node after selecting group in outliner active element in properties panel is not updated after selecting group from outliner. To fix this, remove the layer specific condition. Also renamed the function for clarity. Pull Request: https://projects.blender.org/blender/blender/pulls/121970 --- .../editors/space_outliner/outliner_select.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index b81a9d78ce8..7a158ef14d3 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -492,17 +492,16 @@ static void tree_element_gplayer_activate(bContext *C, TreeElement *te, TreeStor } } -static void tree_element_grease_pencil_layer_activate(bContext *C, - TreeElement *te, - TreeStoreElem *tselem) +static void tree_element_grease_pencil_node_activate(bContext *C, + TreeElement *te, + TreeStoreElem *tselem) { GreasePencil &grease_pencil = *(GreasePencil *)tselem->id; bke::greasepencil::TreeNode &node = tree_element_cast(te)->node(); - if (node.is_layer()) { - grease_pencil.set_active_layer(&node.as_layer()); - DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY); - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, &grease_pencil); - } + + grease_pencil.set_active_node(&node); + DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY); + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, &grease_pencil); } static void tree_element_bonecollection_activate(bContext *C, @@ -872,7 +871,7 @@ void tree_element_type_active_set(bContext *C, tree_element_gplayer_activate(C, te, tselem); break; case TSE_GREASE_PENCIL_NODE: - tree_element_grease_pencil_layer_activate(C, te, tselem); + tree_element_grease_pencil_node_activate(C, te, tselem); break; case TSE_VIEW_COLLECTION_BASE: tree_element_master_collection_activate(C);