ResourceImporterScene: Replace animation bool with an import type string enum#87787
Conversation
|
The problem with enums is that they cannot be extended at all, not even by extensions. However, if we really are planning to only support 3 cases: animation library, mesh library and scene, then this really belongs as part of the MeshLibrary change. |
|
@lyuma My initial plan was for this only to be extendable from within ResourceImporterScene itself, in which case you can add to the enum. However a String or StringName would also work well, I can change it to that. I'm not totally sure about the requirements to allow this class to be extended outside of Godot but I'm all good with leaving the option open. EDIT: Done, it uses Strings now. |
f8b1dd6 to
c0f88e7
Compare
c0f88e7 to
9eeb5b9
Compare
9eeb5b9 to
6ce4558
Compare
6ce4558 to
bbc5c51
Compare
bbc5c51 to
8142012
Compare
lyuma
left a comment
There was a problem hiding this comment.
I realize this is only changing the internal api which means plugins don't get to use the new types, but we are going to rework the public apis in another change in the future.
it makes sense to start with this internal change as is.
8142012 to
9dd71c6
Compare
|
Thanks! |
The current code for ResourceImporterScene has a boolean for importing an animation library, and if false, it imports as a scene. This is not ideal, a boolean does not make much sense because there are more than 2 conceivable possibilities, we don't want to hard-code "animation or scene". This PR replaces this bool with an enum.
In the future we can add more possibilities to this enum, like importing a mesh resource. This PR is part of godotengine/godot-proposals#7494 I am working on it in small pieces to avoid huge unreviewable PRs.