You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently been having problems with the way the inspector handles the float valueNAN and INF starting with this pull request -- existing NAN values are displayed as 0, and it is impossible to enter NAN into a field without editing the scene/resource's file by hand. This is for a good reason -- a lot of built-in nodes cause problems when one of their fields is set to NAN -- but it is limiting for user-created nodes and resources. While it's supposedly Bad Practice, I have often been using NAN as a sort of special value / undefined value because using null would require changing the field's type to Variant and making everything harder to edit, and this change to the behavior of Range nodes has made this incredibly inconvenient.
To my understanding, the best way to fix this would be to add a boolean field in Range nodes like allow_infinite (set to false by default) which when true allows the user to enter values like NAN and INF, and then add new versions of the export annotation to enable or disable this. I would personally prefer for allow_infinite to be opt-out for export fields rather than opt-in -- probably anything marked just as @export would have allow_infinite set to true by default and anything with a specified range would have allow_infinite set to false by default, with the option to change this. NaN values probably won't cause problems in most cases and users are unlikely to enter NaN or INF without meaning to. However, it'd make sense to me for the current behavior to be the default for both the fields of built-in nodes (especially those known to crash when infinite values are entered) and Range nodes in applications made with Godot.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently been having problems with the way the inspector handles the float value
NAN
andINF
starting with this pull request -- existingNAN
values are displayed as 0, and it is impossible to enterNAN
into a field without editing the scene/resource's file by hand. This is for a good reason -- a lot of built-in nodes cause problems when one of their fields is set toNAN
-- but it is limiting for user-created nodes and resources. While it's supposedly Bad Practice, I have often been usingNAN
as a sort of special value / undefined value because usingnull
would require changing the field's type to Variant and making everything harder to edit, and this change to the behavior ofRange
nodes has made this incredibly inconvenient.To my understanding, the best way to fix this would be to add a boolean field in Range nodes like
allow_infinite
(set to false by default) which when true allows the user to enter values likeNAN
andINF
, and then add new versions of theexport
annotation to enable or disable this. I would personally prefer forallow_infinite
to be opt-out for export fields rather than opt-in -- probably anything marked just as@export
would haveallow_infinite
set to true by default and anything with a specified range would haveallow_infinite
set tofalse
by default, with the option to change this. NaN values probably won't cause problems in most cases and users are unlikely to enter NaN or INF without meaning to. However, it'd make sense to me for the current behavior to be the default for both the fields of built-in nodes (especially those known to crash when infinite values are entered) andRange
nodes in applications made with Godot.previous discussion
Beta Was this translation helpful? Give feedback.
All reactions