GLTF: Allow importing files as Mesh or MeshLibrary directly #107840
+580
−0
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 #107856 (mutually exclusive: only one can be merged, the other must be closed)
Implements godotengine/godot-proposals#7494 for glTF, ArrayMesh, and MeshLibrary.
Depends on #107838 and goes well with #107836 (both 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 glTF 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 ResourceImporter approach is just one of the possible implementations. The other approach is to make a mesh out of a generated Godot scene with ResourceImporterScene: #107856 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.