How to import using GLTFDocument in the editor

Godot Version

4.2

Question

Hi folks! The issue I am struggling with is GLTFDocument is leaving me with a scene full of ImporterMeshInstance3D nodes rather than a MeshInstance3D nodes. These are invisible in a normal scene, and don’t work at all as I need.

When running at runtime (e.g., hit play), then the import process works as expected.

I see three possibilities:

    1. I figure out how to render ImporterMeshInstance3D nodes
    1. I figure out how to convert them to MeshInstance3D nodes
    1. I figure out how to use GLTFDocument in the editor so it just gives me correct nodes to start with.

Any ideas?

OK I’m actually making progress. I found GLTFDocumentExtensionConvertImporterMesh. The only issue is I can’t figure out how to apply it. Presumably inside of gltf_state_load.add_used_extension? (should be user right?

But what ‘name’ should I pass in? It takes just a string.

Marking as solved. This was the missing line: gltf_document_load.register_gltf_document_extension(GLTFDocumentExtensionConvertImporterMesh.new(), true)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.