diff options
-rw-r--r-- | editor/plugins/skeleton_3d_editor_plugin.cpp | 27 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 2 |
2 files changed, 16 insertions, 13 deletions
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index aec1a09e48..aadc7a2e66 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -528,22 +528,25 @@ void Skeleton3DEditor::move_skeleton_bone(NodePath p_skeleton_path, int32_t p_se void Skeleton3DEditor::_joint_tree_selection_changed() { TreeItem *selected = joint_tree->get_selected(); - if (!selected) { - return; - } - const String path = selected->get_metadata(0); - if (!path.begins_with("bones/")) { - return; + if (selected) { + const String path = selected->get_metadata(0); + if (!path.begins_with("bones/")) { + return; + } + const int b_idx = path.get_slicec('/', 1).to_int(); + selected_bone = b_idx; + if (pose_editor) { + const String bone_path = "bones/" + itos(b_idx) + "/"; + pose_editor->set_target(bone_path); + pose_editor->set_keyable(keyable); + } } - const int b_idx = path.get_slicec('/', 1).to_int(); - selected_bone = b_idx; - if (pose_editor) { - const String bone_path = "bones/" + itos(b_idx) + "/"; - pose_editor->set_target(bone_path); - pose_editor->set_keyable(keyable); + + if (pose_editor && pose_editor->is_inside_tree()) { pose_editor->set_visible(selected); } set_bone_options_enabled(selected); + _update_properties(); _update_gizmo_visible(); } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 102fe18502..6e1f506e58 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -624,7 +624,7 @@ void TabContainer::set_all_tabs_in_front(bool p_in_front) { all_tabs_in_front = p_in_front; remove_child(tab_bar); - add_child(tab_bar, false, all_tabs_in_front ? INTERNAL_MODE_BACK : INTERNAL_MODE_FRONT); + add_child(tab_bar, false, all_tabs_in_front ? INTERNAL_MODE_FRONT : INTERNAL_MODE_BACK); } bool TabContainer::is_all_tabs_in_front() const { |