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

Document GDScript export category and property grouping #3444

Merged
merged 2 commits into from
May 4, 2020
Merged

Document GDScript export category and property grouping #3444

merged 2 commits into from
May 4, 2020

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Apr 25, 2020

Helps godotengine/godot#4378, godotengine/godot#10303.

I'm not sure how thorough this has to be, but good enough, better than nothing.

@mhilbrunner mhilbrunner merged commit 387882f into godotengine:master May 4, 2020
@mhilbrunner
Copy link
Member

Merged, thanks!

@Xrayez Xrayez deleted the gd-export-category-group branch May 4, 2020 14:38
@EricEzaM
Copy link
Contributor

EricEzaM commented May 12, 2020

I am trying to get this to work but just cant... Can this be expanded on please?

I am adding the code for _get_property_list() and ensuring my script is in tool mode... but nothing changes.

edit: After some fiddling about, it is clear that the hint_string="rotate" is not needed... it is simply the case that every successive property added to properties[] will be a part of the group defined above. I think it should also be mentioned that in order to actually get properties to show up in the inspector, you need to use usage = PROPERTY_USAGE_DEFAULT, and optionally | PROPERTY_USAGE_SCRIPT_VARIABLE.

Also, how useful is this really since if you add an export var to the properties list, it is still show at the top of the inspector and in the grouping? So in the end I would need to replace export vars with just normal vars and mark them as PROPERTY_USAGE_SCRIPT_VARIABLE in get_properties? I guess it does achieve the end goal but it is a bit convoluted.

@Xrayez
Copy link
Contributor Author

Xrayez commented May 12, 2020

@EricEzaM yeah this doesn't work well for existing properties defined with export var. In fact this is mostly useful in cases where you want to add properties programatically, so you have a control over the order of properties being inserted to the inspector. But you could also probably override the behavior of existing properties as in godotengine/godot-proposals#761 (comment).

Also see concrete example I'm using myself in godotengine/godot#10303 (comment).

Tbh this needs a more thorough introduction on the _get_property_list(), but that also means describing the full functionality of it, could take days to test and document this properly.

I guess it does achieve the end goal but it is a bit convoluted.

Tbh the export system itself is a bit convoluted: godotengine/godot-proposals#298.

@ghost
Copy link

ghost commented Apr 28, 2021

Hey, does "hint_string" actually do anything? I can't get it to shorten the property names.

@fire
Copy link
Member

fire commented Apr 28, 2021

@ShatReal contact me sometime and I’ll give a run-through. One use is defining what type a variant of type object is.

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

Successfully merging this pull request may close these issues.

5 participants