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

Exporting arrays of hints #3586

Closed
bojidar-bg opened this issue Feb 4, 2016 · 7 comments
Closed

Exporting arrays of hints #3586

bojidar-bg opened this issue Feb 4, 2016 · 7 comments

Comments

@bojidar-bg
Copy link
Contributor

TL;DR; Support exporting of arrays with a given export hint, as in export([], String, FILE)


It would be nice if one can export an array of some export type, like an array of enums, an array of filepaths, etc. So, in other words, support not only:

export(String, FILE) var file
export(NodePath) var nodepath

but also:

export([], String, FILE) var files
export([], NodePath) var nodepaths

or even:

export([], [], String, FILE) var files_2d_array
export([], [], NodePath) var nodepaths_2d_array

Because syntax needs some discussion, I would go on and propose a few variants:

  • 1a. Square brackets ([ and ]) before other export parameters
export([], String, FILE) var files
export([], [], float) var heights
export([], Array) var anything_array_2d
export([], []) var anything_array_2d # Or maybe not?
  • 1b. Array before other export parameters
export(Array, String, FILE) var files
export(Array, Array, float) var heights
export(Array, Array) var anything_array_2d
  • 2a. Brackets after export parameters
export(String, FILE)[] var files
export(float)[][] var heights
export[][] var anything_array_2d
  • 2b. Brackets after export parameters, alteranative multi-dimetional
export(float)[,] var heights
export[,] var anything_array_2d
  • 3a. Brackets before export parameters
export[](String, FILE) var files
export[][](float) var heights
export[][] var anything_array_2d # Same as 2a
  • 3b. Brackets before export parameters, alteranative multi-dimetional
export[,](float) var heights
export[,] var anything_array_2d # Same as 2b
  • 4a. Plural inflections on params, disallowing multi-dimensional exports
export(String, FILE)s var files
export(Array)s var anything_array_2d
# Can't export typed multidimenstional arrays, such as float[][]
  • 4b. Plural inflections on keyword, disallowing multi-dimensional exports
exports(String, FILE) var files
exports(Array) var anything_array_2d
# Can't export typed multidimenstional arrays, such as float[][]

As for my own preference, I like 1b and 3a the most, because I think they would match the current style. But 1a isn't too bad either. I wouldn't go with any of 2b, 3b, 4a or 4b, as they don't match the style well enough.


P.S. I'm not looking for workarounds, and I know that they exist for NodePaths or 2D arrays. Also, some things like exported enums or file paths can't be really worked around without editor plugins for the moment.

P.P.S. There was a similar issue earlier #3388, but it wasn't as general as this one, and it got closed as it was asking for some way to assign resources (not any export type) in arrays.

@LeonardMeagher2
Copy link
Contributor

It'd also be nice if you could export a subClass with exported variables exposed, and also export an array of subclasses.

@bojidar-bg
Copy link
Contributor Author

@LeonardMeagher2 Better open another issue about it, as this is about arrays, and your is about custom types.

@reduz
Copy link
Member

reduz commented Feb 7, 2016

Typed arrays are planned, in fact.. but not for the near future. Tagging 3.0 for now

@bojidar-bg
Copy link
Contributor Author

@reduz I'm not talking about typed arrays, but about exporting arrays of hints.

@bojidar-bg bojidar-bg changed the title "Typed" export arrays Exporting arrays of hints Feb 8, 2016
@akien-mga akien-mga modified the milestones: 2.1, 3.0 Mar 22, 2016
@akien-mga
Copy link
Member

Not critical for the upcoming 2.1, so moving to the next milestone.

@akien-mga akien-mga modified the milestones: 2.2, 2.1 Jul 15, 2016
@henriiquecampos
Copy link
Contributor

This would made plugins and tools so much more easier. I'm now trying to make an arrays of meshes, and the only way currently is to set a general purpose Array, then create an index of type Object, then set the Object to be a Mesh. Too many steps for, let's say, an artist if he/she want to set 5 Meshes with 5 LOD.

@bojidar-bg
Copy link
Contributor Author

Hm.. guess I can try doing it 😃

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

6 participants