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

Grouping for exported vars in the editor #2707

Closed
2plus2makes5 opened this issue May 10, 2021 · 1 comment
Closed

Grouping for exported vars in the editor #2707

2plus2makes5 opened this issue May 10, 2021 · 1 comment

Comments

@2plus2makes5
Copy link

2plus2makes5 commented May 10, 2021

Describe the project you are working on

Dungeon RPG

Describe the problem or limitation you are having in your project

Some classes have lots of export vars and since they are presented as a simple long list it's often hard to find fast what i'm searching for.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would be really helpful if exported vars were presented in a cleaner and more organized way, i thought of some kind of custom grouping like for the vars of the base classes, think of "Transform", "Matrix", "Visibility" for Spatial or "Geometry", Baked Light" and "Lod" for GeometryInstance for example.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I don't know what would be the best way to do it, i think that one solution could be writing in the code something like:

...
export group "infos"
export var name:="dude"
export var age:=30
...
export group "stats"
export var hp:=100
export var strength:=10
...

in this case name, age and all the following export vars before the group "stats" would be grouped in "infos" while hp, strength and the following export vars would be grouped in "stats".

An alternative and more general solution would be to give us the possibility to export var that are instances of classes, it would work like this:

class Stats:
var hp:=100
var strength:=100
...
pass

export(Stats) stats

in that case in the editor we would see hp and strength grouped under "stats".

If this enhancement will not be used often, can it be worked around with a few lines of script?

I don't think it can be done with a few line of scripts, but in any case i think it would be used often.

Is there a reason why this should be core and not an add-on in the asset library?

I think something like this is definitively core, but i wouldn't mind an add-on i guess.

@YuriSizov
Copy link
Contributor

I don't think it can be done with a few line of scripts, but in any case i think it would be used often.

This can indeed be done with some lines of scripts, though not a few. Here is this in action.

export group "infos"

This will be supported, but we currently use annotations. Syntax proposed by vnen is @export_category and @export_group.


Duplicate of #1255 though.

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

No branches or pull requests

2 participants