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

Cannot export Variant in GDScript 2.0 #43183

Open
Xrayez opened this issue Oct 29, 2020 · 4 comments
Open

Cannot export Variant in GDScript 2.0 #43183

Xrayez opened this issue Oct 29, 2020 · 4 comments

Comments

@Xrayez
Copy link
Contributor

Xrayez commented Oct 29, 2020

Godot version:
a4f70d7

OS/device including version:
Windows 10.

Issue description:
Try to export Variant:

godot_export_variant_error

This should be possible because it's possible to do in C++, as seen in https://github.com/godot-extended-libraries/json, with PROPERTY_USAGE_NIL_IS_VARIANT (which is not exposed to scripting either).

See also godotengine/godot-proposals#1740.

Steps to reproduce:
Write this script:

class_name JSONResource extends Resource

@export var data: Variant
@export var json: String

Minimal reproduction project:
godot_export_variant.zip

@Chaosus Chaosus added this to the 4.0 milestone Oct 30, 2020
@vnen
Copy link
Member

vnen commented Nov 3, 2020

I think this would require a change in the inspector to allow the user to actually set some value. Like what was done in #33080.

@Xrayez
Copy link
Contributor Author

Xrayez commented Nov 3, 2020

Could be implemented something similar to what I described in #43238. I've actually implemented an entire VariantResource for this purpose in Goost: goostengine/goost#30.

Looking at #33080, that's basically an editor implementation of VariantResource, just the other way around. 👀

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Feb 23, 2023
@BasilYes
Copy link

Something about this issue? Values in dictionaries work like Variant could be.

@dalexeev
Copy link
Member

@BasilYes See #33080. The PR needs salvation/re-implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants