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

Add get_supported_gltf_extensions to GLTFDocument #96251

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

aaronfranke
Copy link
Member

This method returns a list of all support glTF extensions, including extensions supported directly by the engine, and extensions supported by user plugins registering GLTFDocumentExtension classes.

This was requested by @BastiaanOlij: "I have a need to communicate the list of extensions we support to an external system so that it can limit/extend the GLTF document it is going to provide to me."

Most of this logic already existed in _parse_gltf_extensions, but now it is exposed. I also sorted the output, since this method is not expected to be called often, and it makes the output more predictable and easier to read.

This PR will conflict with #93722 and #94165, but it will be very easy to rebase them. This PR should be merged first.

Example output when ran in an empty Godot project as of this PR:

["EXT_texture_webp", "GODOT_single_root", "KHR_lights_punctual", "KHR_materials_emissive_strength", "KHR_materials_pbrSpecularGlossiness", "KHR_materials_unlit", "KHR_texture_basisu", "KHR_texture_transform", "OMI_collider", "OMI_physics_body", "OMI_physics_shape"]

Example output when run in a project that provides additional extensions in plugins:

["EXT_texture_webp", "GODOT_single_root", "KHR_lights_punctual", "KHR_materials_emissive_strength", "KHR_materials_pbrSpecularGlossiness", "KHR_materials_unlit", "KHR_texture_basisu", "KHR_texture_transform", "KHR_xmp_json_ld", "OMI_collider", "OMI_physics_body", "OMI_physics_joint", "OMI_physics_shape", "OMI_seat", "OMI_spawn_point", "OMI_vehicle_body", "OMI_vehicle_hover_thruster", "OMI_vehicle_thruster", "OMI_vehicle_wheel"]

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Exactly what I was looking for! Thanks @aaronfranke

@akien-mga akien-mga merged commit faa3688 into godotengine:master Aug 29, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@aaronfranke aaronfranke deleted the gltf-get-supported-ext branch August 29, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants