Skip to content
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 editor allows defining editor-only metadata #59852

Closed
Calinou opened this issue Apr 3, 2022 · 3 comments · Fixed by #59969
Closed

Metadata editor allows defining editor-only metadata #59852

Calinou opened this issue Apr 3, 2022 · 3 comments · Fixed by #59969

Comments

@Calinou
Copy link
Member

Calinou commented Apr 3, 2022

Godot version

4.0.alpha (c630c20)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 510.60.02)

Issue description

The new metadata editor allows defining editor-only metadata, but not reading it. This is probably confusing and should be disallowed (although setting editor-only metadata from code should remain allowed).

Steps to reproduce

  • Add a node.
  • Select the node in the Scene tree dock, go to the inspector and click Add Metadata at the bottom.
  • Add metadata with the name _test.
  • Notice that the metadata doesn't appear in the inspector.
  • Attach a script to the node, with print(has_meta("_test")) in the _ready() function.
  • Run the project. Notice that it prints true since the metadata is defined – it's just not visible in the editor.

Minimal reproduction project

test_editor_only_metadata.zip

@KoBeWi
Copy link
Member

KoBeWi commented Apr 3, 2022

Here's a relevant code:

if (name == "") {
error = TTR("Metadata can't be empty.");
} else if (!name.is_valid_identifier()) {
error = TTR("Invalid metadata identifier.");
} else if (object->has_meta(name)) {
error = TTR("Metadata already exists.");
}

@Ayush-singla27
Copy link
Contributor

Can i work on this issue? I would like to solve this issue as my first open source contribution !

@Calinou
Copy link
Member Author

Calinou commented Apr 4, 2022

Can i work on this issue? I would like to solve this issue as my first open source contribution !

Sure 🙂

@KoBeWi KoBeWi moved this to To Assess in 4.x Priority Issues Apr 21, 2022
@KoBeWi KoBeWi moved this from To Assess to In Progress in 4.x Priority Issues Apr 21, 2022
Repository owner moved this from In Progress to Done in 4.x Priority Issues May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants