Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Skeleton3D & PhysicalBone3D editor errors #76592

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions editor/plugins/physical_bone_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) {
}

void PhysicalBone3DEditorPlugin::edit(Object *p_node) {
selected = static_cast<PhysicalBone3D *>(p_node); // Trust it
ERR_FAIL_COND(!selected);

physical_bone_editor.set_selected(selected);
PhysicalBone3D *bone = Object::cast_to<PhysicalBone3D>(p_node);
if (bone) {
selected = bone;
physical_bone_editor.set_selected(selected);
}
}
4 changes: 1 addition & 3 deletions editor/plugins/skeleton_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ void Skeleton3DEditor::create_editors() {
void Skeleton3DEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
create_editors();
update_joint_tree();
update_editors();

joint_tree->connect("item_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed));
joint_tree->connect("item_mouse_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select));
Expand Down Expand Up @@ -946,8 +946,6 @@ void fragment() {
handles_mesh_instance->set_cast_shadows_setting(GeometryInstance3D::SHADOW_CASTING_SETTING_OFF);
handles_mesh.instantiate();
handles_mesh_instance->set_mesh(handles_mesh);

create_editors();
}

void Skeleton3DEditor::update_bone_original() {
Expand Down