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

Improve overriding the root type or root name in the scene importer #79774

Merged

Conversation

aaronfranke
Copy link
Member

The code to override the root type and root name of an imported 3D scene in the current master is a bit weird/hacky.

For the type, the code in master checks if the type is set to anything other than Node3D, if so then it will replace the root node with that type, if not it will keep the node the importer provided. This means that there is no way to explicitly ask for the type to be Node3D. With this PR, the default value is an empty string, and it can be set to Node3D explicitly. Existing *.import files will continue to work, since they would cause Node3D to be replaced with Node3D.

For the name, the code in master checks if the name is different from "Scene Root", if so then it will replace the name with that name, or if it is equal to "Scene Root" then it will use the file name. Similarly to the above, this means that there is no way to explicitly ask for the name to be "Scene Root". Also, this means that there is no way for the importer to suggest a name for the scene (GLTF files may contain this information, but it's currently not used by Godot for the node name). With this PR, the default value is an empty string. Existing *.import files will continue to work. There still is no way to explicitly set the name to "Scene Root" because I added a special case to keep existing *.import files working, but we can remove this special case in a future compatibility breakage.

This PR also adds documentation for the nodes/ scene import properties.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of any reason against this.

Maybe there's some compatibility concerns.

@aaronfranke aaronfranke force-pushed the scene-import-root-type-name branch from b2f263f to aa187d8 Compare August 1, 2023 18:31
@akien-mga akien-mga merged commit f5b2d7d into godotengine:master Aug 2, 2023
@akien-mga
Copy link
Member

Thanks!

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