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 stuck editor cameras and fix 3D error spam for non-finite transforms #103845

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Mar 9, 2025

Fixes #80755 in a better way, fixes #96824, supersedes #102966.

Before #81076, in Godot 4.1 and earlier, Godot allowed INF/NAN in Range. This meant that it was possible to use INF/NAN for node transforms. The problem is that the editor code doesn't have any checks to handle this case. In both 2D and 3D, focusing a node at a non-finite position would break the editor camera. Additionally, in 3D, selecting a node with a non-finite transform would cause lots of errors to print to the console.

After #81076, in Godot 4.2 to 4.4, Godot does not allow INF/NAN in Range. This meant that the user could not type INF/NAN to set a node to a non-finite transform. However, this broke the ability to use INF/NAN values elsewhere, and broke the display of existing INF/NAN values.

More importantly, #81076 did not actually fix the underlying bug, so #80755 is actually not fixed yet. If you set a node to have a non-finite transform through means other than the editor inspector, such as editing a .tscn file or using a @tool script, then the same bug is still present in Godot 4.4-stable: you can break the editor camera and get error spam.

In PR #100414 I proposed to allow Range to use INF/NAN again, but this would make the underlying bug #80755 easier to trigger, so I am making this PR which should be merged first.

This PR adds checks to the 2D and 3D editor code to skip non-finite transforms when focusing the editor camera, calculating bounding boxes, and positioning gizmos. This fixes the camera breaking and fixes the error spam in 3D.

@arkology
Copy link
Contributor

arkology commented Mar 9, 2025

#102966 👀

@aaronfranke aaronfranke force-pushed the fix-ed-stuck-cam-nonfin-xform branch from 7132e3c to c7649f4 Compare March 9, 2025 07:10
@aaronfranke aaronfranke requested a review from KoBeWi March 9, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants