Skip to content

Expose bevy::pbr::gltf module.#24863

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
eswartz:expose-gltfmaterial-to-standardmaterial
Jul 6, 2026
Merged

Expose bevy::pbr::gltf module.#24863
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
eswartz:expose-gltfmaterial-to-standardmaterial

Conversation

@eswartz

@eswartz eswartz commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Objective

This allows users to reuse standard_material_from_gltf_material given the 0.19 changes to expose GltfMaterial instead of StandardMaterial.

Clients that iterate Gltf and GltfMesh to reclaim the ability to manually instantiate the materials from GltfMaterial as in 0.18.

See https://discord.com/channels/691052431525675048/749332104487108618/1521606712623235082

Solution

  • Expose bevy::pbr::gltf as pub. It only exposes the given function as pub.

(An alternative is to provide pub use standard_material_from_gltf_material from bevy::pbr, but that makes the client use bevy::pbr::standard_material_from_gltf_material which might be confusing.

Testing

  • Tested with my code that can now use use bevy::pbr::gltf::standard_material_from_gltf_material;.

This allows users to reuse `standard_material_from_gltf_material`
given the 0.19 changes to expose GltfMaterial instead of StandardMaterial.

@ChristopherBiscardi ChristopherBiscardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't need this to access the StandardMaterials being loaded, but it is nonetheless useful to make it public.

Image

@ChristopherBiscardi ChristopherBiscardi added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-glTF Related to the glTF 3D scene/model format labels Jul 3, 2026
@Zeophlite Zeophlite added this to the 0.19.1 milestone Jul 4, 2026
@Zeophlite Zeophlite added the C-Bug An unexpected or incorrect behavior label Jul 4, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 6, 2026
Merged via the queue into bevyengine:main with commit 717d527 Jul 6, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-glTF Related to the glTF 3D scene/model format C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants