godot icon indicating copy to clipboard operation
godot copied to clipboard

Implement KHR_node_visibility in the GLTF module

Open aaronfranke opened this issue 6 days ago • 2 comments

Implements KHR_node_visibility https://github.com/KhronosGroup/glTF/pull/2410 in Godot, which allows glTF nodes to be marked as not visible. Both import and export are supported.

Details: The glTF visibility system works the same as Godot's visibility system, only affecting visuals, which makes this really easy to implement. Since this extension was extremely simple, I decided to just implement it in GLTFDocument rather than writing a GLTFDocumentExtension class for it. I also made it a required extension on export, to ensure that user assets are always rendered correctly. However most scenes don't contain invisible objects, so this won't impact most scenes.

Aside from the GLTF module changes, this PR also adds 2 lines to the general scene importer code to ensure visibility is preserved when converting ImporterMeshInstance3D nodes to MeshInstance3D nodes.

Test file: cube_visibility_example.zip

aaronfranke avatar Jun 28 '24 22:06 aaronfranke