Godot Version
v4.4.1.stable.official [49a5bc7b6]
Question
I noticed, that when defining exported properties through _get_property_list
, the values are always saved to the .tscn
file. Whereas when using @export
annotations, only overrides are stored – defaults are assumed to remain the same.
Is this an inteded feature or am I missing something? I use the _property_can_revert
and _property_get_revert
methods too.
Yes, this is expected behavior with the PROPERTY_USAGE_STORAGE
flag.
You can think of it as @export
’ed default values are already serialized in the script while _get_property_list()
values are computed on read.
What behavior do you want to see?
Yes, this is expected behavior
Alright, that’s cool. Thanks!
What behavior do you want to see?
My default values are always static, they don’t change ever. I’d expect the same behavior as with @export
ed variables: Unless the user changes the value in an inspector field, the variable isn’t stored in the scene file. It makes changing defaults a lot easier. Currently I end up grepping all of the variable occurrences in all scene files (where it has the old default value) and changing it manually to the new default.
Not sure why it is like this. It doesn’t feel like a bug, but it’s strange.