-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Expose "meta" to the Inspector #22642
Conversation
Wasn't the plan to eventually deprecate metadata? I can't remember. |
@dualmatrix Sort of, but making it more accessible was also favorable. |
@dualmatrix may refer to #18591, many users were in favor to keep and make it visible. |
80df6c5
to
94db48b
Compare
94db48b
to
de93652
Compare
@akien-mga Good to go! Turned the |
de93652
to
3c484f5
Compare
Conflicts solved. |
I'm not sure this should be merged before we get rid of all editor usage of metadata. Else people might erase some values and we will end up with complains about the editor not working. |
@groud I don't see how could this make it possible to break the editor. The only thing this commit does is expose the |
The editor uses metadata for internal stuff. For example, the nodes locking or grouping (in the 2D editor) use an hardcoded metadata of "edit_lock" to check whether or not the node is locked. |
Oh! I didn't even noticed that. Yep, that might be a problem. |
3c484f5
to
704c429
Compare
704c429
to
d128668
Compare
d128668
to
e425f2d
Compare
Moving to 3.2 milestone as we're about to enter the beta stage and release freeze for Godot 3.1. Only bug fixes against issues of the 3.1 milestone (or enhancements to core features of the 3.1 roadmap) will be considered until 3.1-stable is released. Note: If it's merged after 3.1-stable is released, this change might be considered for cherry-picking into a later 3.1.x release. |
We finally got to review this, sorry for the delay. The exposure of editor-only metadata is still a problem, but it shouldn't be blocking for this PR, we can handle it afterwards. There would be two options:
|
Thanks! |
We don't have to add a new dictionary if we have a way to hide a property from both:
|
@groud True, but IMO (ab)using a common dictionary for all editor metadata might be more convenient than manually registering internal properties... though it's true that using properties is cleaner than relying on strings to get metadata from a dict. |
separate editor metadata may be safer for plugins and complex custom nodes too, in particular with users that depend on regular metadata. |
@akien-mga Doing some tests seem that everything works mostly fine, even after all this time. One minor problem (besides the editor metas), is that the metadata properties seem to start with a non-default value, even if they're completely empty: This makes so that every node has a "__meta__" key in the scene files, again, even if empty. This behaviour didn't happen back at 2018, and I don't have a clue in how to fix this. |
Perhaps there should be a way to write this metadata to all scenes in the project so that it doesn't create noise in version control? At least I'd like to make this manually if it can't be fixed easily. |
The empty |
Another issue from this PR, the diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 7ab29e67a..edfdae0b9 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -161,6 +161,8 @@
</method>
</methods>
<members>
+ <member name="__meta__" type="Dictionary" setter="" getter="" default="{}">
+ </member>
<member name="android/modules" type="String" setter="" getter="" default="""">
Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. [code]org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"[/code].
</member> Given the issues outlined above and the fact that the proposed solution in #30715 is a workaround, and the better solution from #29222 is not ready to merge yet, I'll revert this for now. This is still a wanted feature though, so I'd encourage @YeldhamDev to reopen a PR with this code which we could test further and merge once all outstanding issues are handled. Another thing to consider is whether the property should stay named |
For great justice: https://github.com/ballerburg9005/godot-metadata-inspector |
And by "WIP" I mean "I really could use some help on this".
The
metadata
dictionary is part of theObject
class, and exposing stuff from there to the inspector wasn't as easy as I thought it would be.Initially, it looks fine, it's accessible just below the "Script" subcategory, except that unlike "Script", it also appears in literally all inspectors across the editor.
(It will, hopefully) Closes #5433.
EDIT: Done, see below.