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

Import glb and gltf single meshes as root node #8069

Closed
elvisish opened this issue Oct 11, 2023 · 3 comments
Closed

Import glb and gltf single meshes as root node #8069

elvisish opened this issue Oct 11, 2023 · 3 comments

Comments

@elvisish
Copy link

Describe the project you are working on

Walking simulator.

Describe the problem or limitation you are having in your project

When importing a *.glb or *.gltf, even there is a single mesh node, the root is still a Node3D, it would be more convenient if it were auto-detected as a single mesh and imported as the root.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would make it easier to drag a glb or gltf directly into a MeshInstance3D mesharray without having to manually extract the node (either via copy/paste, new instance or extract during import).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

An option to import a glb or gltf that has only a single mesh as the root imported node with a parent Node3D.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It would be import code.

Is there a reason why this should be core and not an add-on in the asset library?

It would be import code.

@Calinou
Copy link
Member

Calinou commented Oct 11, 2023

Unfortunately, doing so would also have a downside. If the structure of the glTF changes later on, the node structure has to be changed in a breaking way.

The current structure imposes some indirection, but it means the root node's type will never change unless you explicitly change it yourself in the Import dock.

@aaronfranke
Copy link
Member

aaronfranke commented Oct 12, 2023

@elvisish I'm planning on working on similar functionality in the near future (next few months). I already opened a proposal here: #7494 and I opened this PR as a small prerequisite cleanup godotengine/godot#82988

My plan is to implement importing as a mesh resource instead of a mesh node, like you can already do with OBJ in Godot, but this is similar enough that I am closing this as a duplicate. If in the future after that proposal is implemented we decide importing as a scene with a single mesh node is useful functionality, we can do that.

@aaronfranke aaronfranke closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
@elvisish
Copy link
Author

@elvisish I'm planning on working on similar functionality in the near future (next few months). I already opened a proposal here: #7494 and I opened this PR as a small prerequisite cleanup godotengine/godot#82988

My plan is to implement importing as a mesh resource instead of a mesh node, like you can already do with OBJ in Godot, but this is similar enough that I am closing this as a duplicate. If in the future after that proposal is implemented we decide importing as a scene with a single mesh node is useful functionality, we can do that.

Tbh, that sounds even better than what I proposed, a mesh resource to just drag into a meshinstance3d node. @Calinou sighested any changes to hierarchy (adding multiple meshes) would break if there was no root, could it work having Godot auto merge the meshes into a single mesh resource if more are added?

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

3 participants