-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Inspector doesn't allow entering values of NAN, INF, etc. for float fields #87664
Comments
I believe I found the pr to partially blame. Using a build from today I can trace a floating point value such as 5.0f not enter that early exit. Inputting 'NAN' from editor causes p_val to be nan(0x8000000000000) and thus enter that early exit. |
Out of curiosity, what do you need these values for?
This is being tracked in #50715 |
I'd say we should be careful about allowing inputting NaN, there's really very little legitimate reason for this, and I'd say we should handle input that produces NaNs as well, like To clarify, this is two different parts, one is for |
Some users may use non-finite numbers to denote undefined values, where |
It was done by design though, to fix bugs that bricked the editor, this was considered a bug, not a feature, it wasn't intended to support it If we are to support it you should have an option to opt in, as it's too dangerous otherwise I'd say we should add a default false option to But I think using NaN as an explicit input is a codesmell, not good practice |
I'd say that part of the Inspector is designed to display & edit values of the Bricking the editor is an editor bug. It's a mistake to have been fixed at At least, displaying & editing logic could be separated. It's definitely wrong to display actual |
While using I would go further to say that the use of My preferred behavior would be to have the |
This issue mentions a (serious) bug as well, that was not picked up by the tagging team. Any float variable containing the value NAN or INF is shown as "0" in the inspector and debugger!!! Especially in the debugger this is rather nasty. |
In case this helps anyone: tooltips in the script editor DO correctly show nan or inf values inside a float variable during debugging. |
Please open a separate issue for this. To resolve this, we may have to do something like partially revert #81076 to make it effective only outside the editor. Alternatively, we need to figure out a way to allow displaying invalid values without allowing them to be entered – which may be easier said than done. There are other cases where this would be beneficial too (such as Range minimum/maximum values edited after-the-fact). |
Tested the bug mentioned above some more and created #88006 |
Tested versions
System information
Godot v4.2.stable - macOS 14.0.0 - GLES3 (Compatibility) - ANGLE (Apple, ANGLE Metal Renderer: Apple M1, Version 14.0 (Build 23A344)) - Apple M1 (8 Threads)
Issue description
It is impossible to enter NaN or positive or negative infinity while editing a float field for a node or resource in the inspector. This was previously possible by typing
NAN
,INF
, etc. into the field, but now attempting to do this results in the value not being changed. There also seems to be a problem where values which are set toNAN
by other means are displayed as 0 when loaded into the inspector (although it doesn't seem like the value is actually changed when this happens), but I haven't tested which versions this happens in.Steps to reproduce
NAN
orINF
into the float field.Minimal reproduction project (MRP)
test.zip
The text was updated successfully, but these errors were encountered: