-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Metadata on resources that are saved as non-Godot resource files (such as GDScript or text-based shaders) aren't saved #84653
Comments
This is expected. GDScript is saved as a plain script file, it doesn't have a place to store metadata. Unlike resources saved as RES/TRES, which can save arbitrary data with them. We should probably disable the section on the inspector for scripts, and document this somewhere. |
Why not invent an @metadata command that can hold that data? It's quite handy for plugins and in-editor things. Vars and exports are fine, but they behave in certain ways. To have data that applies to a script as a whole, despite its inheritance etc. is useful. The metadata becomes like vars for that specific class and not for anything that extends it. And you don't need to new() it only load() it (as a resource). But, yeah, to keep complexity down, the button to add Metadata should not be there for a script. |
That implies modifying scripts from under your feet. This may not be desirable. |
Well, it would be you, the dev, making the metadata, so not that surprising. However, I bow to your experience. |
Be careful when saying things like "This is expected". For whom is it expected for? Is it expected for the developer, who implemented the solution and has the correct mental model of the system's behavior? Or, it is expected for the user, who was never provided with an interface with good enough usability for them to learn the correct mental model? It is expected for the former, but not the latter. Therefore, it is not really correct to say things like "This is expected". There are a huge number of things in Godot that ought to be redesigned (by real UX designers, not programmers) such that the behavior of the system is "expected" from both perspectives, both the engineer who made it and the user who uses it. Apologies for putting you on the spot, I know it's common to say "This is expected" so it's not fair to pick you out like that. |
It is the expected behavior of the system given the limitations and considerations that is contains. Whether it is intuitive or not, whether it is convenient or not, whether it is communicated well or not are all different questions. When we say "This is expected" we are teaching the user that this is what they should expect to happen in this case. As learning the system is a part of building that mental model that you are speaking of. In any case, I don't think sophism is helpful here. Let's stick to the technical argument. |
Note that this limitation applies to any resource type that is saved as a file type that isn't derived from This means that text-based An easy way to implement this in the inspector is to hide the Add Metadata button if the resource path doesn't end with |
|
Fair enough. It may be pedantic, but I still make the point because engineers have a tendency to view things from the perspective of an engineer (as they should), but problems arise when they fail to view things from the perspective of a user, which is required to engineer the usability of a product. Terms such as "expected behavior" only reinforce these bad habits, and so it's a pet peeve of mine when they are used. If it's a big company and there are dedicated designers and dedicated engineers, then engineers don't need to think about usability. However, when the engineers are also the designers, they need to spent significantly more effort trying to forget about their engineering knowledge and view things purely from the users perspective so that they can design. After all, who is the behavior expected for? The engineer or the user? If the engineer is also the designer, then it ought to be for the user. You're right that I derailed, but I couldn't resist saying these things. I'll be quiet from hence forth. |
Godot version
v4.2.beta4.official [93cdacb]
System information
Godot v4.2.beta4 - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (nvidia; 535.129.03) - Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz (6 Threads)
Issue description
I want to put Metadata on a gd script. The Editor lets me do this:
![I have added test_meta:bool in this image.](https://private-user-images.githubusercontent.com/392218/281688267-26cdae12-aa86-4e86-9f4a-da50bb81dffe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTM4MTYsIm5iZiI6MTczOTE1MzUxNiwicGF0aCI6Ii8zOTIyMTgvMjgxNjg4MjY3LTI2Y2RhZTEyLWFhODYtNGU4Ni05ZjRhLWRhNTBiYjgxZGZmZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQwMjExNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hYmFlYTdhNjMwNzg2Mzk4M2Y3MGQ3MGY0N2MyOTJhMWFmODQzYjE1ODQwNGRjMzZhYWY5MzY2M2JlMTY1YTNhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.VAslubUQvwgG50IDJVsZ0jg9PhQbVT6NJ_YhbniMgTs)
Saving the project, closing and re-loading it results in this:
![The metadata is gone.](https://private-user-images.githubusercontent.com/392218/281688506-3f7de89b-886c-49af-9c66-3b09e7592768.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTM4MTYsIm5iZiI6MTczOTE1MzUxNiwicGF0aCI6Ii8zOTIyMTgvMjgxNjg4NTA2LTNmN2RlODliLTg4NmMtNDlhZi05YzY2LTNiMDllNzU5Mjc2OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQwMjExNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNmIyMGM1NzNkOTQ2NDY2OGI5ZGIzZTc3ZjFhOWIyYTk2YmIyMGU4ZDczN2E2NWE3NzI3MjYzYzg0Yzc3MWJiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.FVjtB_JmaaRwZPs96xtfVtMoZHbdSryLWLsf8W1YyDo)
Steps to reproduce
Create a gd script. Double-click it. Go into the Inspector and add metadata. Save project. Close. Open the project and go back to that script in the inspector.
Minimal reproduction project
None required.
The text was updated successfully, but these errors were encountered: