I’m using @tool scripts quite a bit for easier development.
Sometimes this can cause issues. For example, when I have an infinite tween loop for a sprite position that runs in the editor, I don’t necessarily want to save the current position, but keep the original value unchanged. (In my case, I’m using a relative tween, so it doesn’t help if the original sprite position changes on each save.)
I could simply not commit that line, but I’m wondering if Godot has any “pre-save” signal or hook or something so I could reset such a value just before the scene is saved?
Lookup _get_property_list and once you understand that a little, look into the PropertyUsageFlags. I think this one will help you: PROPERTY_USAGE_NO_INSTANCE_STATE
If it’s only about changing the usage, then you don’t need _get_property_list. You can just use @export_custom(PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_INSTANCE_STATE) (since Godot 4.3)
Thanks all for your help and sorry for my late reply. I’ll have some time for Godot tomorrow and will try to use your suggestions to improve this issue in my code. PROPERTY_USAGE_NO_INSTANCE_STATE sounds like a good option, but I’ll also explore _get_property_list which looks very helpful for many use cases. Cheers! It’s much appreciated.