From c57313960dc79122cca28f057ee1e9ffef166346 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Wed, 17 Apr 2024 14:57:11 -0700 Subject: [PATCH] Add missing Default impl to ExtendedMaterial. --- crates/bevy_pbr/src/extended_material.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/bevy_pbr/src/extended_material.rs b/crates/bevy_pbr/src/extended_material.rs index 70f9ec34cc903..60ac6c2fa8165 100644 --- a/crates/bevy_pbr/src/extended_material.rs +++ b/crates/bevy_pbr/src/extended_material.rs @@ -128,6 +128,20 @@ pub struct ExtendedMaterial { pub extension: E, } + +impl Default for ExtendedMaterial + where + B: Material + Default, + E: MaterialExtension + Default, +{ + fn default() -> Self { + Self { + base: B::default(), + extension: E::default(), + } + } +} + // We don't use the `TypePath` derive here due to a bug where `#[reflect(type_path = false)]` // causes the `TypePath` derive to not generate an implementation. impl_type_path!((in bevy_pbr::extended_material) ExtendedMaterial);