Reflect derived traits on all components and resources: bevy_gltf (#15218)

Solves https://github.com/bevyengine/bevy/issues/15187 for bevy_gltf
This commit is contained in:
Blazepaws 2024-09-15 16:47:43 +02:00 committed by GitHub
parent 379696a468
commit 569f68f8a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,6 +107,7 @@ use bevy_app::prelude::*;
use bevy_asset::{Asset, AssetApp, AssetPath, Handle}; use bevy_asset::{Asset, AssetApp, AssetPath, Handle};
use bevy_ecs::{prelude::Component, reflect::ReflectComponent}; use bevy_ecs::{prelude::Component, reflect::ReflectComponent};
use bevy_pbr::StandardMaterial; use bevy_pbr::StandardMaterial;
use bevy_reflect::std_traits::ReflectDefault;
use bevy_reflect::{Reflect, TypePath}; use bevy_reflect::{Reflect, TypePath};
use bevy_render::{ use bevy_render::{
mesh::{skinning::SkinnedMeshInverseBindposes, Mesh, MeshVertexAttribute}, mesh::{skinning::SkinnedMeshInverseBindposes, Mesh, MeshVertexAttribute},
@ -422,7 +423,7 @@ impl GltfPrimitive {
/// ///
/// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras). /// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras).
#[derive(Clone, Debug, Reflect, Default, Component)] #[derive(Clone, Debug, Reflect, Default, Component)]
#[reflect(Component)] #[reflect(Component, Default, Debug)]
pub struct GltfExtras { pub struct GltfExtras {
/// Content of the extra data. /// Content of the extra data.
pub value: String, pub value: String,
@ -432,7 +433,7 @@ pub struct GltfExtras {
/// ///
/// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras). /// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras).
#[derive(Clone, Debug, Reflect, Default, Component)] #[derive(Clone, Debug, Reflect, Default, Component)]
#[reflect(Component)] #[reflect(Component, Default, Debug)]
pub struct GltfSceneExtras { pub struct GltfSceneExtras {
/// Content of the extra data. /// Content of the extra data.
pub value: String, pub value: String,
@ -442,7 +443,7 @@ pub struct GltfSceneExtras {
/// ///
/// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras). /// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras).
#[derive(Clone, Debug, Reflect, Default, Component)] #[derive(Clone, Debug, Reflect, Default, Component)]
#[reflect(Component)] #[reflect(Component, Default, Debug)]
pub struct GltfMeshExtras { pub struct GltfMeshExtras {
/// Content of the extra data. /// Content of the extra data.
pub value: String, pub value: String,
@ -452,7 +453,7 @@ pub struct GltfMeshExtras {
/// ///
/// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras). /// See [the relevant glTF specification section](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-extras).
#[derive(Clone, Debug, Reflect, Default, Component)] #[derive(Clone, Debug, Reflect, Default, Component)]
#[reflect(Component)] #[reflect(Component, Default, Debug)]
pub struct GltfMaterialExtras { pub struct GltfMaterialExtras {
/// Content of the extra data. /// Content of the extra data.
pub value: String, pub value: String,