Merge pull request #60194 from V-Sekai/node_3d_gizmo_fix

This commit is contained in:
Rémi Verschelde 2022-04-13 12:23:01 +02:00 committed by GitHub
commit e44aa166f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -7120,7 +7120,9 @@ void Node3DEditor::_request_gizmo(Object *p_obj) {
}
}
}
sp->update_gizmos();
if (!sp->get_gizmos().is_empty()) {
sp->update_gizmos();
}
}
}

View File

@ -181,15 +181,6 @@ void Node3D::_notification(int p_what) {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint() && get_tree()->is_node_being_edited(this)) {
get_tree()->call_group_flags(0, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_request_gizmo, this);
if (!data.gizmos_disabled) {
for (int i = 0; i < data.gizmos.size(); i++) {
data.gizmos.write[i]->create();
if (is_visible_in_tree()) {
data.gizmos.write[i]->redraw();
}
data.gizmos.write[i]->transform();
}
}
}
#endif
} break;
@ -427,6 +418,7 @@ void Node3D::update_gizmos() {
}
if (data.gizmos.is_empty()) {
get_tree()->call_group_flags(0, SceneStringNames::get_singleton()->_spatial_editor_group, SceneStringNames::get_singleton()->_request_gizmo, this);
return;
}
if (data.gizmos_dirty) {