Skip to content

Commit

Permalink
Fix skeleton 3d editor's toolbar ui deleted from wrong container
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjtxietian committed Sep 24, 2023
1 parent fe5b1c8 commit 2679118
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
23 changes: 3 additions & 20 deletions editor/plugins/skeleton_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ void Skeleton3DEditor::create_editors() {
add_child(file_dialog);

// Create Top Menu Bar.
HBoxContainer *topmenu_bar = memnew(HBoxContainer);
topmenu_bar = memnew(HBoxContainer);
ne->add_control_to_menu_panel(topmenu_bar);

// Create Skeleton Option in Top Menu Bar.
Expand Down Expand Up @@ -1095,25 +1095,8 @@ Skeleton3DEditor::~Skeleton3DEditor() {

Node3DEditor *ne = Node3DEditor::get_singleton();

if (animation_hb) {
ne->remove_control_from_menu_panel(animation_hb);
memdelete(animation_hb);
}

if (separator) {
ne->remove_control_from_menu_panel(separator);
memdelete(separator);
}

if (skeleton_options) {
ne->remove_control_from_menu_panel(skeleton_options);
memdelete(skeleton_options);
}

if (edit_mode_button) {
ne->remove_control_from_menu_panel(edit_mode_button);
memdelete(edit_mode_button);
}
ne->remove_control_from_menu_panel(topmenu_bar);
memdelete(topmenu_bar);
}

bool EditorInspectorPluginSkeleton::can_handle(Object *p_object) {
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/skeleton_3d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Skeleton3DEditor : public VBoxContainer {
BoneTransformEditor *rest_editor = nullptr;
BoneTransformEditor *pose_editor = nullptr;

VSeparator *separator = nullptr;
HBoxContainer *topmenu_bar = nullptr;
MenuButton *skeleton_options = nullptr;
Button *edit_mode_button = nullptr;

Expand Down

0 comments on commit 2679118

Please sign in to comment.