3D scene import: Allow importing files as Mesh or MeshLibrary via ResourceImporterScene #107856
+409
−109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alternative to PR #107840 (mutually exclusive: only one can be merged, the other must be closed)
Implements godotengine/godot-proposals#7494 for all 3D scene formats imported to ArrayMesh and MeshLibrary.
Depends on #107838 and #107855 and goes well with #107836 (all of those PRs are good to merge even without this PR).
MeshLibrary
, and optionally can save these meshes to a file, and optionally can use node names as mesh names. This is useful for 3D model files intended to be used as a collection of meshes, rather than a single model or scene.ArrayMesh
, which is that exact mesh as-is when importing a file with a single mesh, or imports a merged mesh if the file contains multiple meshes.This PR is marked as a discussion because this ResourceImporterScene approach is just one of the possible implementations. The other approach is to use ResourceImporter (not Scene) and more directly generate these from the data in specific formats like glTF: #107840 I briefly discussed this with @fire on Discord and he said he prefers ResourceImporterScene but I'm putting both options on the table.
Here's a copy of what I sent on Discord. We basically have 3 options:
Also, @fire mentioned that "It won't support multi meshes" and that mesh merging "is better done in blender since it's pretty tricky", but I managed to support it anyway, so long as we have PR #107838. I think mesh merging functionality should be supported, regardless of how the importer exposes it.