From f360b88036553072c8273df7c18e0af1d58786b8 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sun, 15 Dec 2024 11:18:22 -0800 Subject: [PATCH] Add missing `#[reflect(Component, Default)]` to `SceneRoot` and `DynamicSceneRoot`. (#16816) Someone forgot to add these, and I need them since I spawn these components in my [glXF] files. [glXF]: https://github.com/pcwalton/bevy-glxf-loader/ --- crates/bevy_scene/src/components.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/bevy_scene/src/components.rs b/crates/bevy_scene/src/components.rs index cf729662f7a2d..8709c7990fd50 100644 --- a/crates/bevy_scene/src/components.rs +++ b/crates/bevy_scene/src/components.rs @@ -1,7 +1,10 @@ use bevy_asset::Handle; use bevy_derive::{Deref, DerefMut}; -use bevy_ecs::component::{require, Component}; -use bevy_reflect::Reflect; +use bevy_ecs::{ + component::{require, Component}, + prelude::ReflectComponent, +}; +use bevy_reflect::{prelude::ReflectDefault, Reflect}; use bevy_transform::components::Transform; use derive_more::derive::From; @@ -13,6 +16,7 @@ use crate::{DynamicScene, Scene}; /// Adding this component will spawn the scene as a child of that entity. /// Once it's spawned, the entity will have a [`SceneInstance`](crate::SceneInstance) component. #[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect, PartialEq, Eq, From)] +#[reflect(Component, Default, Debug, PartialEq)] #[require(Transform)] #[cfg_attr(feature = "bevy_render", require(Visibility))] pub struct SceneRoot(pub Handle); @@ -20,6 +24,7 @@ pub struct SceneRoot(pub Handle); /// Adding this component will spawn the scene as a child of that entity. /// Once it's spawned, the entity will have a [`SceneInstance`](crate::SceneInstance) component. #[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect, PartialEq, Eq, From)] +#[reflect(Component, Default, Debug, PartialEq)] #[require(Transform)] #[cfg_attr(feature = "bevy_render", require(Visibility))] pub struct DynamicSceneRoot(pub Handle);