From 990c4591f26634cc8491339a3ebe6849992a6b57 Mon Sep 17 00:00:00 2001 From: Gino Valente Date: Sat, 9 Sep 2023 12:28:42 -0700 Subject: [PATCH 1/6] Add AssetSchematic --- Cargo.toml | 5 + .../bevy/asset_loading/Camera.prototype.ron | 15 + .../bevy/asset_loading/Cube.prototype.ron | 25 ++ .../bevy/asset_loading/Light.prototype.ron | 14 + .../bevy/asset_loading/Monkey.prototype.ron | 23 ++ .../bevy/asset_loading/Sphere.prototype.ron | 25 ++ .../bevy/asset_loading/monkey/Monkey.gltf | 122 ++++++ .../src/{proto => assets}/event.rs | 0 bevy_proto_backend/src/assets/extension.rs | 31 ++ bevy_proto_backend/src/assets/mod.rs | 110 +++++ bevy_proto_backend/src/assets/proto.rs | 205 ++++++++++ bevy_proto_backend/src/assets/schematic.rs | 50 +++ bevy_proto_backend/src/deps/collection.rs | 8 +- .../src/impls/bevy_impls/asset.rs | 16 +- .../src/impls/bevy_impls/pbr.rs | 267 +++++++++++- .../src/impls/bevy_impls/render.rs | 117 ------ .../src/impls/bevy_impls/render/mod.rs | 5 + .../impls/bevy_impls/render/registrations.rs | 188 +++++++++ .../impls/bevy_impls/render/shapes/boxes.rs | 42 ++ .../bevy_impls/render/shapes/capsules.rs | 55 +++ .../impls/bevy_impls/render/shapes/circles.rs | 22 + .../impls/bevy_impls/render/shapes/cubes.rs | 18 + .../bevy_impls/render/shapes/cylinders.rs | 32 ++ .../src/impls/bevy_impls/render/shapes/mod.rs | 21 + .../impls/bevy_impls/render/shapes/planes.rs | 30 ++ .../bevy_impls/render/shapes/polygons.rs | 24 ++ .../impls/bevy_impls/render/shapes/quads.rs | 23 ++ .../impls/bevy_impls/render/shapes/spheres.rs | 42 ++ .../impls/bevy_impls/render/shapes/toruses.rs | 24 ++ .../src/impls/bevy_impls/sprite.rs | 180 ++++++++- .../src/impls/bevy_impls/text.rs | 63 ++- bevy_proto_backend/src/impls/bevy_impls/ui.rs | 9 +- bevy_proto_backend/src/impls/macros.rs | 6 +- bevy_proto_backend/src/lib.rs | 2 +- bevy_proto_backend/src/load/load_context.rs | 4 +- bevy_proto_backend/src/plugin.rs | 7 +- bevy_proto_backend/src/proto/assets.rs | 39 -- bevy_proto_backend/src/proto/commands.rs | 20 +- bevy_proto_backend/src/proto/config.rs | 6 +- bevy_proto_backend/src/proto/mod.rs | 4 - bevy_proto_backend/src/registration/params.rs | 3 +- .../src/registration/registry.rs | 3 +- bevy_proto_backend/src/schematics/dynamic.rs | 46 ++- bevy_proto_backend/src/schematics/id.rs | 53 +++ bevy_proto_backend/src/schematics/mod.rs | 2 + .../src/schematics/schematic.rs | 59 ++- bevy_proto_backend/src/tree/access.rs | 16 +- bevy_proto_derive/Cargo.toml | 1 + .../asset_schematic/container_attributes.rs | 40 ++ .../src/asset_schematic/derive.rs | 164 ++++++++ .../src/asset_schematic/external.rs | 44 ++ bevy_proto_derive/src/asset_schematic/mod.rs | 6 + .../src/common/data/derive_type.rs | 19 + bevy_proto_derive/src/common/data/mod.rs | 7 + .../src/common/data/schematic_data.rs | 35 ++ bevy_proto_derive/src/common/data/variants.rs | 153 +++++++ .../src/common/fields/asset_config.rs | 203 ++++++++++ bevy_proto_derive/src/common/fields/config.rs | 160 ++++++++ .../src/common/fields/entity_config.rs | 37 ++ bevy_proto_derive/src/common/fields/mod.rs | 11 + .../src/common/fields/schematic_field.rs | 379 ++++++++++++++++++ .../src/common/fields/schematic_fields.rs | 216 ++++++++++ bevy_proto_derive/src/common/input/attr.rs | 32 ++ .../src/common/input/converters.rs | 89 ++++ .../src/common/input/generate.rs | 227 +++++++++++ .../src/common/input/input_ty.rs | 38 ++ bevy_proto_derive/src/common/input/io.rs | 107 +++++ bevy_proto_derive/src/common/input/mod.rs | 13 + .../src/common/input/output_ty.rs | 22 + bevy_proto_derive/src/common/mod.rs | 3 + bevy_proto_derive/src/lib.rs | 121 +++++- .../src/schematic/container_attributes.rs | 180 ++------- bevy_proto_derive/src/schematic/data.rs | 78 ---- bevy_proto_derive/src/schematic/derive.rs | 259 ++++-------- .../src/schematic/field_attributes.rs | 360 ----------------- bevy_proto_derive/src/schematic/fields.rs | 177 -------- bevy_proto_derive/src/schematic/idents.rs | 27 -- bevy_proto_derive/src/schematic/input.rs | 238 ----------- bevy_proto_derive/src/schematic/mod.rs | 11 - bevy_proto_derive/src/schematic/self_type.rs | 45 --- bevy_proto_derive/src/schematic/structs.rs | 74 ---- bevy_proto_derive/src/schematic/utils.rs | 14 - bevy_proto_derive/src/schematic/variants.rs | 249 ------------ bevy_proto_derive/src/utils.rs | 33 -- bevy_proto_derive/src/utils/attr.rs | 131 ++++++ bevy_proto_derive/src/utils/constants.rs | 38 ++ bevy_proto_derive/src/utils/crates.rs | 43 ++ bevy_proto_derive/src/utils/exports.rs | 42 ++ bevy_proto_derive/src/utils/meta.rs | 69 ++++ bevy_proto_derive/src/utils/mod.rs | 11 + bevy_proto_derive/src/utils/next_id.rs | 24 ++ examples/bevy/asset_loading.rs | 58 +++ examples/bevy/ui.rs | 4 +- examples/custom_schematic.rs | 11 +- examples/derive_schematic.rs | 103 +++-- src/conditions.rs | 26 ++ src/config.rs | 14 +- src/custom.rs | 138 +++++-- src/hooks.rs | 10 +- src/lib.rs | 7 +- 100 files changed, 4693 insertions(+), 1989 deletions(-) create mode 100644 assets/examples/bevy/asset_loading/Camera.prototype.ron create mode 100644 assets/examples/bevy/asset_loading/Cube.prototype.ron create mode 100644 assets/examples/bevy/asset_loading/Light.prototype.ron create mode 100644 assets/examples/bevy/asset_loading/Monkey.prototype.ron create mode 100644 assets/examples/bevy/asset_loading/Sphere.prototype.ron create mode 100644 assets/examples/bevy/asset_loading/monkey/Monkey.gltf rename bevy_proto_backend/src/{proto => assets}/event.rs (100%) create mode 100644 bevy_proto_backend/src/assets/extension.rs create mode 100644 bevy_proto_backend/src/assets/mod.rs create mode 100644 bevy_proto_backend/src/assets/proto.rs create mode 100644 bevy_proto_backend/src/assets/schematic.rs delete mode 100644 bevy_proto_backend/src/impls/bevy_impls/render.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/mod.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/registrations.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/boxes.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/capsules.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/circles.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/cubes.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/cylinders.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/mod.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/planes.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/polygons.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/quads.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/spheres.rs create mode 100644 bevy_proto_backend/src/impls/bevy_impls/render/shapes/toruses.rs delete mode 100644 bevy_proto_backend/src/proto/assets.rs create mode 100644 bevy_proto_backend/src/schematics/id.rs create mode 100644 bevy_proto_derive/src/asset_schematic/container_attributes.rs create mode 100644 bevy_proto_derive/src/asset_schematic/derive.rs create mode 100644 bevy_proto_derive/src/asset_schematic/external.rs create mode 100644 bevy_proto_derive/src/asset_schematic/mod.rs create mode 100644 bevy_proto_derive/src/common/data/derive_type.rs create mode 100644 bevy_proto_derive/src/common/data/mod.rs create mode 100644 bevy_proto_derive/src/common/data/schematic_data.rs create mode 100644 bevy_proto_derive/src/common/data/variants.rs create mode 100644 bevy_proto_derive/src/common/fields/asset_config.rs create mode 100644 bevy_proto_derive/src/common/fields/config.rs create mode 100644 bevy_proto_derive/src/common/fields/entity_config.rs create mode 100644 bevy_proto_derive/src/common/fields/mod.rs create mode 100644 bevy_proto_derive/src/common/fields/schematic_field.rs create mode 100644 bevy_proto_derive/src/common/fields/schematic_fields.rs create mode 100644 bevy_proto_derive/src/common/input/attr.rs create mode 100644 bevy_proto_derive/src/common/input/converters.rs create mode 100644 bevy_proto_derive/src/common/input/generate.rs create mode 100644 bevy_proto_derive/src/common/input/input_ty.rs create mode 100644 bevy_proto_derive/src/common/input/io.rs create mode 100644 bevy_proto_derive/src/common/input/mod.rs create mode 100644 bevy_proto_derive/src/common/input/output_ty.rs create mode 100644 bevy_proto_derive/src/common/mod.rs delete mode 100644 bevy_proto_derive/src/schematic/data.rs delete mode 100644 bevy_proto_derive/src/schematic/field_attributes.rs delete mode 100644 bevy_proto_derive/src/schematic/fields.rs delete mode 100644 bevy_proto_derive/src/schematic/idents.rs delete mode 100644 bevy_proto_derive/src/schematic/input.rs delete mode 100644 bevy_proto_derive/src/schematic/self_type.rs delete mode 100644 bevy_proto_derive/src/schematic/structs.rs delete mode 100644 bevy_proto_derive/src/schematic/utils.rs delete mode 100644 bevy_proto_derive/src/schematic/variants.rs delete mode 100644 bevy_proto_derive/src/utils.rs create mode 100644 bevy_proto_derive/src/utils/attr.rs create mode 100644 bevy_proto_derive/src/utils/constants.rs create mode 100644 bevy_proto_derive/src/utils/crates.rs create mode 100644 bevy_proto_derive/src/utils/exports.rs create mode 100644 bevy_proto_derive/src/utils/meta.rs create mode 100644 bevy_proto_derive/src/utils/mod.rs create mode 100644 bevy_proto_derive/src/utils/next_id.rs create mode 100644 examples/bevy/asset_loading.rs diff --git a/Cargo.toml b/Cargo.toml index 231b5ff..fec4534 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -165,6 +165,11 @@ name = "templates" path = "examples/templates.rs" required-features = ["ron", "auto_name", "custom_schematics", "bevy_sprite", "yaml"] +[[example]] +name = "bevy_asset_loading" +path = "examples/bevy/asset_loading.rs" +required-features = ["ron", "auto_name", "custom_schematics"] + [[example]] name = "bevy_ui" path = "examples/bevy/ui.rs" diff --git a/assets/examples/bevy/asset_loading/Camera.prototype.ron b/assets/examples/bevy/asset_loading/Camera.prototype.ron new file mode 100644 index 0000000..31e69a8 --- /dev/null +++ b/assets/examples/bevy/asset_loading/Camera.prototype.ron @@ -0,0 +1,15 @@ +( + name: "Camera", + schematics: { + "bevy_proto::custom::Camera3dBundle": ( + transform: ( + translation: ( + x: 0, + y: 3.0, + z: 10.0 + ), + rotation: (-0.14521314, -0.0, -0.0, 0.9894004), + ) + ) + } +) \ No newline at end of file diff --git a/assets/examples/bevy/asset_loading/Cube.prototype.ron b/assets/examples/bevy/asset_loading/Cube.prototype.ron new file mode 100644 index 0000000..6f93743 --- /dev/null +++ b/assets/examples/bevy/asset_loading/Cube.prototype.ron @@ -0,0 +1,25 @@ +( + name: "Cube", + schematics: { + "bevy_proto::custom::MaterialMeshBundle": ( + mesh: Asset(Cube(( + size: 2.0, + ))), + material: Asset(( + base_color: Rgba( + red: 0.8, + green: 0.7, + blue: 0.6, + alpha: 1.0 + ), + )), + transform: ( + translation: ( + x: 0.0, + y: 0.0, + z: 0.0 + ) + ), + ) + }, +) diff --git a/assets/examples/bevy/asset_loading/Light.prototype.ron b/assets/examples/bevy/asset_loading/Light.prototype.ron new file mode 100644 index 0000000..848b0e7 --- /dev/null +++ b/assets/examples/bevy/asset_loading/Light.prototype.ron @@ -0,0 +1,14 @@ +( + name: "Light", + schematics: { + "bevy_proto::custom::PointLightBundle": ( + transform: ( + translation: ( + x: 4.0, + y: 5.0, + z: 4.0 + ), + ) + ) + } +) \ No newline at end of file diff --git a/assets/examples/bevy/asset_loading/Monkey.prototype.ron b/assets/examples/bevy/asset_loading/Monkey.prototype.ron new file mode 100644 index 0000000..6f2ccf1 --- /dev/null +++ b/assets/examples/bevy/asset_loading/Monkey.prototype.ron @@ -0,0 +1,23 @@ +( + name: "Monkey", + schematics: { + "bevy_proto::custom::MaterialMeshBundle": ( + mesh: AssetPath("examples/bevy/asset_loading/monkey/Monkey.gltf#Mesh0/Primitive0"), + material: Asset(( + base_color: Rgba( + red: 0.8, + green: 0.7, + blue: 0.6, + alpha: 1.0 + ), + )), + transform: ( + translation: ( + x: -3.0, + y: 0.0, + z: 0.0 + ) + ), + ) + } +) \ No newline at end of file diff --git a/assets/examples/bevy/asset_loading/Sphere.prototype.ron b/assets/examples/bevy/asset_loading/Sphere.prototype.ron new file mode 100644 index 0000000..8df6cc2 --- /dev/null +++ b/assets/examples/bevy/asset_loading/Sphere.prototype.ron @@ -0,0 +1,25 @@ +( + name: "Sphere", + schematics: { + "bevy_proto::custom::MaterialMeshBundle": ( + mesh: Asset(UvSphere(( + radius: 1.0, + ))), + material: Asset(( + base_color: Rgba( + red: 0.8, + green: 0.7, + blue: 0.6, + alpha: 1.0 + ), + )), + transform: ( + translation: ( + x: 3.0, + y: 0.0, + z: 0.0 + ) + ), + ) + } +) diff --git a/assets/examples/bevy/asset_loading/monkey/Monkey.gltf b/assets/examples/bevy/asset_loading/monkey/Monkey.gltf new file mode 100644 index 0000000..f7b34ed --- /dev/null +++ b/assets/examples/bevy/asset_loading/monkey/Monkey.gltf @@ -0,0 +1,122 @@ +{ + "asset" : { + "generator" : "Khronos glTF Blender I/O v1.3.48", + "version" : "2.0" + }, + "scene" : 0, + "scenes" : [ + { + "name" : "Scene", + "nodes" : [ + 0 + ] + } + ], + "nodes" : [ + { + "mesh" : 0, + "name" : "Suzanne" + } + ], + "materials" : [ + { + "doubleSided" : true, + "emissiveFactor" : [ + 0, + 0, + 0 + ], + "name" : "Material", + "pbrMetallicRoughness" : { + "baseColorFactor" : [ + 0.7612724900245667, + 0.5813313126564026, + 0.41983750462532043, + 1 + ], + "metallicFactor" : 0, + "roughnessFactor" : 0.4000000059604645 + } + } + ], + "meshes" : [ + { + "name" : "Suzanne", + "primitives" : [ + { + "attributes" : { + "POSITION" : 0, + "NORMAL" : 1, + "TEXCOORD_0" : 2 + }, + "indices" : 3, + "material" : 0 + } + ] + } + ], + "accessors" : [ + { + "bufferView" : 0, + "componentType" : 5126, + "count" : 2012, + "max" : [ + 1.325934886932373, + 0.9392361640930176, + 0.8223199844360352 + ], + "min" : [ + -1.325934886932373, + -0.9704862236976624, + -0.7782661318778992 + ], + "type" : "VEC3" + }, + { + "bufferView" : 1, + "componentType" : 5126, + "count" : 2012, + "type" : "VEC3" + }, + { + "bufferView" : 2, + "componentType" : 5126, + "count" : 2012, + "type" : "VEC2" + }, + { + "bufferView" : 3, + "componentType" : 5123, + "count" : 11808, + "type" : "SCALAR" + } + ], + "bufferViews" : [ + { + "buffer" : 0, + "byteLength" : 24144, + "byteOffset" : 0 + }, + { + "buffer" : 0, + "byteLength" : 24144, + "byteOffset" : 24144 + }, + { + "buffer" : 0, + "byteLength" : 16096, + "byteOffset" : 48288 + }, + { + "buffer" : 0, + "byteLength" : 23616, + "byteOffset" : 64384 + } + ], + "buffers" : [ + { + "byteLength" : 88000, + "uri" : "data:application/octet-stream;base64,yHHyPnMceT4cxz8/HeftPnOcSj7IUUA/rOb6Po4DPz5zMDg/5VgAP8ixeD4BgDc/HcfgPh3HIz4dx0E/kIPqPqxqDj6QAzo/VlX3PnQc5z1WVS8/HecFPwKAMD7IES0/OY4JP8hxeD7lOCw/VlX3vnIc5z1WVS8/kYPqvqxqDj6PAzo/q+b6vo8DPz50MDg/HOcFvwKAMD7IES0/Hcfgvh3HIz4dx0E/H+ftvnOcSj7JUUA/yHHyvnMceT4dxz8/5FgAv8exeD4BgDc/Oo4Jv8dxeD7kOCw/OpYNPwCAJD6QHyA/c9wRP+a4eD7IMR8/VpUBPzmOuj2sqiI/AQAHP1ZVlT0CABU/rIoUPwCAGj6sShI/VlUZP1dVeT5XVRE/AQAHv1ZVlT0BABU/V5UBvzqOuj2sqiI/O5YNvwCAJD6OHyA/rIoUvwGAGj6rShI/ctwRv+a4eD7IMR8/VlUZv1dVeT5XVRE/O27YPgIAlj1yjDI/ydXePleVNz06YCY/cxy0Ph7HcT07DjY/jwO0PnQc5zwedyo/AQC0PqiqKjusqh0/A8DkPldVrTxWFRk/AQC0vqiqKjusqh0/jwO0vnQc5zwedyo/ydXevlaVNz06YCY/AsDkvldVrTxWFRk/cxy0vh7HcT06DjY/Om7YvgIA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sFjwbUB/sF1AfEB48GqAWtBY8GrQXUB9QHrQVpBdQHaQXVB8QH1AfVB8QH1QfFB18F0wfWB18F1gfSBdMHwQfIB9MHyAfWB9YHyAeVB9YHlQfXB9IF1gfXB9IF1wfUBZgHygfYB5gH2AfZB8oHxQfVB8oH1QfYB9gH1QdpBdgHaQXdBdkH2AfdBdkH3QXcBb4F4wXaB74F2gd8BuMF1AXXB+MF1wfaB9oH1weVB9oHlQeUB3wG2geUB3wGlAc1BpgH2QfbB5gH2weZB9kH3AXnBdkH5wXbB9sH5wXDBdsHwwWBBpkH2weBBpkHgQY7Bg==" + } + ] +} diff --git a/bevy_proto_backend/src/proto/event.rs b/bevy_proto_backend/src/assets/event.rs similarity index 100% rename from bevy_proto_backend/src/proto/event.rs rename to bevy_proto_backend/src/assets/event.rs diff --git a/bevy_proto_backend/src/assets/extension.rs b/bevy_proto_backend/src/assets/extension.rs new file mode 100644 index 0000000..fee6bca --- /dev/null +++ b/bevy_proto_backend/src/assets/extension.rs @@ -0,0 +1,31 @@ +use crate::assets::{AssetSchematic, InlinableProtoAsset, ProtoAsset}; +use bevy::app::App; +use bevy::asset::{AddAsset, Handle}; +use bevy::reflect::TypePath; + +/// [`App`] extension trait for working with [`AssetSchematics`]. +/// +/// [`AssetSchematics`]: AssetSchematic +pub trait AssetSchematicAppExt { + /// Registers an [`AssetSchematic`]. + /// + /// This is a convenience method for the following registrations: + /// - `Handle` + /// - `ProtoAsset` + /// - `InlinableProtoAsset` + /// - `T::Input` + fn register_asset_schematic(&mut self) -> &mut Self; +} + +impl AssetSchematicAppExt for App { + fn register_asset_schematic(&mut self) -> &mut Self { + self.add_asset::() + .register_type::>() + .register_type::>>() + .register_type::>() + .register_type::>>() + .register_type::>() + .register_type::>>() + .register_type::() + } +} diff --git a/bevy_proto_backend/src/assets/mod.rs b/bevy_proto_backend/src/assets/mod.rs new file mode 100644 index 0000000..5f523b5 --- /dev/null +++ b/bevy_proto_backend/src/assets/mod.rs @@ -0,0 +1,110 @@ +//! Schematic types used to build [assets]. +//! +//! # Handling Assets +//! +//! Bevy uses a [`Handle`] type to reference assets. +//! Unfortunately, this type isn't very useful serialized as it doesn't directly +//! track the asset's path. +//! +//! In order to reference assets in a serialized format, +//! this crate defines a special [`ProtoAsset`] type which does keep track of the path. +//! This can then be used in the input type for a [`Schematic`] to load assets. +//! And, in fact, when deriving `Schematic`, a `Handle`-containing field +//! can be marked with the `#[schematic(asset)]` attribute to automatically handle this. +//! +//! ``` +//! # use bevy::prelude::*; +//! # use bevy_proto_derive::Schematic; +//! # use bevy_proto_backend::schematics::ReflectSchematic; +//! #[derive(Component, Reflect, Schematic)] +//! #[reflect(Schematic)] +//! struct Player { +//! #[schematic(asset)] +//! sprite: Handle +//! } +//! ``` +//! +//! This will generate a schematic input type with the appropriate `ProtoAsset` field: +//! +//! ``` +//! # use bevy::prelude::*; +//! # use bevy_proto_backend::assets::ProtoAsset; +//! #[derive(Reflect)] +//! struct PlayerInput { +//! sprite: ProtoAsset +//! } +//! ``` +//! +//! See the [derive macro documentation](bevy_proto_derive::Schematic) for more details +//! on this attribute and its various arguments. +//! +//! # Asset Schematics +//! +//! While referencing an asset by path is good enough for most cases, +//! sometimes it would be better to just define an asset as part of a prototype, +//! without needing to create a completely separate asset file. +//! +//! This is where [`AssetSchematic`] comes in. +//! This trait defines an [`Input`] data type and an [`Output`] asset type, +//! which can be used to create assets inline with a given schematic. +//! Because the implementor does not need to be the asset type itself, +//! any number of schematics can be defined for a single asset type. +//! +//! An asset schematic is used much like normal assets, +//! except, instead of using `ProtoAsset`, [`InlinableProtoAsset`] is used. +//! +//! The `AssetSchematic` trait can be derived and can even reference other assets. +//! It can then be referenced in a schematic using the `#[schematic(asset)]` attribute +//! with the `inline` argument. +//! +//! ``` +//! # use bevy::prelude::*; +//! # use bevy::reflect::{TypePath, TypeUuid}; +//! # use bevy_proto_derive::{AssetSchematic, Schematic}; +//! # use bevy_proto_backend::schematics::ReflectSchematic; +//! #[derive(AssetSchematic, TypeUuid, TypePath)] +//! #[uuid = "a3de79e1-0364-4fdf-9a82-9fae288e0aed"] +//! struct Level { +//! name: String, +//! #[asset_schematic(asset)] +//! background: Handle +//! } +//! +//! #[derive(Component, Reflect, Schematic)] +//! #[reflect(Schematic)] +//! struct CurrentLevel { +//! #[schematic(asset(inline))] +//! sprite: Handle +//! } +//! ``` +//! +//! Asset schematics have a lot of moving parts that need to be registered in the app. +//! To make things easier, this crate comes with an [extension trait] which can be used +//! to automatically register all of the necessary types. +//! +//! ```ignore +//! app.register_asset_schematic::(); +//! ``` +//! +//! See the [derive macro documentation](bevy_proto_derive::AssetSchematic) for more details. +//! +//! [assets]: bevy::asset::Asset +//! [`Handle`]: bevy::asset::Handle +//! [`ProtoAsset`]: ProtoAsset +//! [`Schematic`]: crate::schematics::Schematic +//! [`AssetSchematic`]: AssetSchematic +//! [`Input`]: AssetSchematic::Input +//! [`Output`]: AssetSchematic::Output +//! [`InlinableProtoAsset`]: InlinableProtoAsset +//! [extension trait]: AssetSchematicAppExt + +pub use bevy_proto_derive::AssetSchematic; +pub use event::*; +pub use extension::*; +pub use proto::*; +pub use schematic::*; + +mod event; +mod extension; +mod proto; +mod schematic; diff --git a/bevy_proto_backend/src/assets/proto.rs b/bevy_proto_backend/src/assets/proto.rs new file mode 100644 index 0000000..758ff3b --- /dev/null +++ b/bevy_proto_backend/src/assets/proto.rs @@ -0,0 +1,205 @@ +use crate::assets::{AssetSchematic, PreloadAssetSchematic}; +use crate::deps::DependenciesBuilder; +use crate::schematics::{ + FromSchematicInput, FromSchematicPreloadInput, SchematicContext, SchematicId, +}; +use bevy::asset::{Asset, AssetServer, Assets, Handle, HandleId}; +use bevy::prelude::Reflect; +use bevy::reflect::TypeUuid; +use std::fmt::{Debug, Formatter}; +use std::hash::{Hash, Hasher}; + +/// Replacement type for asset handles in a [`Schematic::Input`] generated by the +/// [derive macro]. +/// +/// This allows assets to be referenced by path from within a schematic. +/// To inline an asset, use [`InlinableProtoAsset`]. +/// +/// [`Schematic::Input`]: crate::schematics::Schematic::Input +/// [derive macro]: bevy_proto_derive::Schematic +#[derive(Reflect)] +pub enum ProtoAsset { + /// The path to an asset relative to the `assets` directory. + AssetPath(String), + /// An existing [`Handle`]. + /// + /// Note: This handle should always be _weak_. + Handle(Handle), +} + +impl Default for ProtoAsset { + fn default() -> Self { + Self::Handle(Handle::default()) + } +} + +impl Clone for ProtoAsset { + fn clone(&self) -> Self { + match self { + Self::AssetPath(path) => Self::AssetPath(path.clone()), + Self::Handle(handle) => Self::Handle(handle.clone()), + } + } +} + +impl Debug for ProtoAsset { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::AssetPath(path) => f.debug_tuple("AssetPath").field(path).finish(), + Self::Handle(handle) => f.debug_tuple("Handle").field(handle).finish(), + } + } +} + +impl Eq for ProtoAsset {} + +impl PartialEq for ProtoAsset { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Self::AssetPath(a), Self::AssetPath(b)) => a == b, + (Self::Handle(a), Self::Handle(b)) => a == b, + _ => false, + } + } +} + +impl Hash for ProtoAsset { + fn hash(&self, state: &mut H) { + match self { + ProtoAsset::AssetPath(path) => path.hash(state), + ProtoAsset::Handle(handle) => handle.hash(state), + } + } +} + +impl From> for ProtoAsset { + fn from(value: Handle) -> Self { + Self::Handle(value.clone_weak()) + } +} + +impl FromSchematicInput> for Handle { + fn from_input(input: ProtoAsset, _id: SchematicId, context: &mut SchematicContext) -> Self { + match input { + ProtoAsset::AssetPath(path) => context.world().resource::().load(path), + ProtoAsset::Handle(handle) => { + context.world().resource::().get_handle(handle) + } + } + } +} + +impl FromSchematicPreloadInput> for Handle { + /// # Panics + /// + /// This will panic if the input is a [`ProtoAsset::Handle`]. + fn from_preload_input( + input: ProtoAsset, + _id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self { + match input { + ProtoAsset::AssetPath(path) => dependencies.add_dependency(path), + ProtoAsset::Handle(_) => unimplemented!("cannot preload a handle"), + } + } +} + +/// Replacement type for asset handles in a [`Schematic::Input`] generated by the +/// [derive macro]. +/// +/// Unlike the base [`ProtoAsset`], this type allows for assets to be inlined +/// using the [`AssetSchematic`] trait. +/// +/// [`Schematic::Input`]: crate::schematics::Schematic::Input +/// [derive macro]: bevy_proto_derive::Schematic +#[derive(Reflect)] +pub enum InlinableProtoAsset { + /// The input to an [`AssetSchematic`] of type `T`. + /// + /// This is used to generate the actual asset at runtime. + Asset(T::Input), + /// The path to an asset relative to the `assets` directory. + AssetPath(String), + /// An existing [`Handle`]. + Handle(Handle), +} + +impl Default for InlinableProtoAsset { + fn default() -> Self { + Self::Handle(Handle::default()) + } +} + +impl FromSchematicInput> for Handle { + fn from_input( + input: InlinableProtoAsset, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { + match input { + InlinableProtoAsset::Asset(input) => { + let asset = T::load( + &input, + id.next(bevy::utils::Uuid::from_u128( + 0x54e193c39c62443da0884276371f0a27, + )), + context, + ); + context.world_mut().resource_mut::>().set( + HandleId::new( + T::Output::TYPE_UUID, + id.next(bevy::utils::Uuid::from_u128( + 0xf9dd72f06c22482fa0bdd45b417cb946, + )) + .value(), + ), + asset, + ) + } + InlinableProtoAsset::AssetPath(path) => { + context.world().resource::().load(path) + } + InlinableProtoAsset::Handle(handle) => { + context.world().resource::().get_handle(handle) + } + } + } +} + +impl FromSchematicPreloadInput> + for Handle +{ + /// # Panics + /// + /// This will panic if the input is a [`InlinableProtoAsset::Handle`]. + fn from_preload_input( + input: InlinableProtoAsset, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self { + match input { + InlinableProtoAsset::Asset(input) => { + let asset = T::preload( + input, + id.next(bevy::utils::Uuid::from_u128( + 0x54e193c39c62443da0884276371f0a27, + )), + dependencies, + ); + dependencies.add_asset( + asset, + format!( + "{}", + id.next(bevy::utils::Uuid::from_u128( + 0x5760fb8ae11d4936986f5f19226c3e58 + )) + .value() + ), + ) + } + InlinableProtoAsset::AssetPath(path) => dependencies.add_dependency(path), + InlinableProtoAsset::Handle(_) => unimplemented!("cannot preload a handle"), + } + } +} diff --git a/bevy_proto_backend/src/assets/schematic.rs b/bevy_proto_backend/src/assets/schematic.rs new file mode 100644 index 0000000..4299ea2 --- /dev/null +++ b/bevy_proto_backend/src/assets/schematic.rs @@ -0,0 +1,50 @@ +use crate::deps::DependenciesBuilder; +use crate::schematics::{SchematicContext, SchematicId}; +use bevy::asset::Asset; +use bevy::reflect::{FromReflect, GetTypeRegistration}; + +/// Trait used to create a schematic for an [asset] which allows them to be +/// defined and loaded within a [schematic]. +/// +/// The implementor of this trait does not need to be an asset itself. +/// The actual asset type is defined by the associated [`Output`] type. +/// This allows assets to be defined with any number of schematics, +/// even for external assets. +/// +/// This trait can either be manually implemented or [derived]. +/// +/// See the [module-level documentation] for details. +/// +/// [asset]: Asset +/// [schematic]: crate::schematics::Schematic +/// [`Output`]: AssetSchematic::Output +/// [derived]: bevy_proto_derive::AssetSchematic +/// [module-level documentation]: crate::assets +pub trait AssetSchematic: 'static { + /// The input type of the schematic. + /// + /// This is the type that is deserialized from a prototype file + /// and used to store the asset's data. + type Input: FromReflect + GetTypeRegistration; + /// The output asset type. + type Output: Asset; + + /// Loads the [output] asset from the given [input]. + /// + /// [output]: Self::Output + /// [input]: Self::Input + fn load(input: &Self::Input, id: SchematicId, context: &mut SchematicContext) -> Self::Output; +} + +/// Allows an [`AssetSchematic`] to preload its asset. +pub trait PreloadAssetSchematic: AssetSchematic { + /// Preloads the [output] asset from the given [input]. + /// + /// [output]: Self::Output + /// [input]: Self::Input + fn preload( + input: Self::Input, + id: SchematicId, + context: &mut DependenciesBuilder, + ) -> Self::Output; +} diff --git a/bevy_proto_backend/src/deps/collection.rs b/bevy_proto_backend/src/deps/collection.rs index 646ab63..780a26d 100644 --- a/bevy_proto_backend/src/deps/collection.rs +++ b/bevy_proto_backend/src/deps/collection.rs @@ -1,6 +1,6 @@ use std::fmt::{Debug, Formatter}; -use bevy::asset::{Asset, AssetPath, Handle, HandleUntyped, LoadContext}; +use bevy::asset::{Asset, AssetPath, Handle, HandleUntyped, LoadContext, LoadedAsset}; use bevy::utils::hashbrown::hash_map::Iter; use bevy::utils::HashMap; @@ -90,6 +90,12 @@ impl<'a, 'ctx> DependenciesBuilder<'a, 'ctx> { handle } + /// Add a labeled asset. + pub fn add_asset>(&mut self, asset: T, label: L) -> Handle { + self.ctx + .set_labeled_asset(label.as_ref(), LoadedAsset::new(asset)) + } + fn get_handle>>( &mut self, path: P, diff --git a/bevy_proto_backend/src/impls/bevy_impls/asset.rs b/bevy_proto_backend/src/impls/bevy_impls/asset.rs index f8f241f..3279027 100644 --- a/bevy_proto_backend/src/impls/bevy_impls/asset.rs +++ b/bevy_proto_backend/src/impls/bevy_impls/asset.rs @@ -1,11 +1,10 @@ use bevy::app::App; -use bevy::asset::{Asset, AssetServer, Handle}; +use bevy::asset::{Asset, Handle}; use crate::impls::macros::register_schematic; use bevy_proto_derive::impl_external_schematic; -use crate::proto::ProtoAsset; -use crate::schematics::{FromSchematicInput, SchematicContext}; +use crate::assets::ProtoAsset; #[allow(unused_variables)] pub(super) fn register(app: &mut App) { @@ -59,15 +58,6 @@ pub(super) fn register(app: &mut App) { } impl_external_schematic! { - #[schematic(from = ProtoAsset)] + #[schematic(from = ProtoAsset)] struct Handle {} - // --- - impl FromSchematicInput for Handle { - fn from_input(input: ProtoAsset, context: &mut SchematicContext) -> Self { - match input { - ProtoAsset::AssetPath(path) => context.world().resource::().load(path), - ProtoAsset::HandleId(handle_id) => context.world().resource::().get_handle(handle_id), - } - } - } } diff --git a/bevy_proto_backend/src/impls/bevy_impls/pbr.rs b/bevy_proto_backend/src/impls/bevy_impls/pbr.rs index 5c70fab..d32a69b 100644 --- a/bevy_proto_backend/src/impls/bevy_impls/pbr.rs +++ b/bevy_proto_backend/src/impls/bevy_impls/pbr.rs @@ -1,15 +1,22 @@ use bevy::app::App; use bevy::pbr::wireframe::Wireframe; use bevy::pbr::{ - CascadeShadowConfig, CascadeShadowConfigBuilder, ClusterConfig, DirectionalLight, - EnvironmentMapLight, FogFalloff, FogSettings, NotShadowCaster, NotShadowReceiver, PointLight, - SpotLight, + AlphaMode, CascadeShadowConfig, CascadeShadowConfigBuilder, ClusterConfig, DirectionalLight, + EnvironmentMapLight, FogFalloff, FogSettings, NotShadowCaster, NotShadowReceiver, + ParallaxMappingMethod, PointLight, SpotLight, StandardMaterial, }; use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::prelude::Image; +use bevy::render::render_resource::Face; +use crate::assets::{AssetSchematicAppExt, ProtoAsset}; +use crate::deps::DependenciesBuilder; use crate::impls::macros::{from_to_default, register_schematic}; use crate::proto::ProtoColor; -use bevy_proto_derive::impl_external_schematic; +use crate::schematics::{ + FromSchematicInput, FromSchematicPreloadInput, SchematicContext, SchematicId, +}; +use bevy_proto_derive::{impl_external_asset_schematic, impl_external_schematic}; pub(super) fn register(app: &mut App) { register_schematic!( @@ -25,6 +32,9 @@ pub(super) fn register(app: &mut App) { SpotLight, Wireframe, ); + + app.register_asset_schematic::() + .register_type::(); } impl_external_schematic! { @@ -75,9 +85,9 @@ impl_external_schematic! { impl_external_schematic! { pub struct EnvironmentMapLight { - #[schematic(asset(lazy))] + #[schematic(asset)] pub diffuse_map: Handle, - #[schematic(asset(lazy))] + #[schematic(asset)] pub specular_map: Handle, } } @@ -125,3 +135,248 @@ impl_external_schematic! { impl_external_schematic! { struct Wireframe; } + +impl_external_asset_schematic! { + #[asset_schematic(from = StandardMaterialInput)] + struct StandardMaterial {} +} + +#[derive(Reflect)] +#[reflect(Default)] +pub struct StandardMaterialInput { + pub base_color: ProtoColor, + pub base_color_texture: Option>, + pub emissive: ProtoColor, + pub emissive_texture: Option>, + pub perceptual_roughness: f32, + pub metallic: f32, + pub metallic_roughness_texture: Option>, + pub reflectance: f32, + pub normal_map_texture: Option>, + pub flip_normal_map_y: bool, + pub occlusion_texture: Option>, + pub double_sided: bool, + pub cull_mode: Option, + pub unlit: bool, + pub fog_enabled: bool, + pub alpha_mode: AlphaMode, + pub depth_bias: f32, + pub depth_map: Option>, + pub parallax_depth_scale: f32, + pub parallax_mapping_method: ParallaxMappingMethod, + pub max_parallax_layer_count: f32, +} + +impl Default for StandardMaterialInput { + fn default() -> Self { + let base = StandardMaterial::default(); + + Self { + base_color: base.base_color.into(), + base_color_texture: base.base_color_texture.map(ProtoAsset::Handle), + emissive: base.emissive.into(), + emissive_texture: base.emissive_texture.map(ProtoAsset::Handle), + perceptual_roughness: base.perceptual_roughness, + metallic: base.metallic, + metallic_roughness_texture: base.metallic_roughness_texture.map(ProtoAsset::Handle), + reflectance: base.reflectance, + normal_map_texture: base.normal_map_texture.map(ProtoAsset::Handle), + flip_normal_map_y: base.flip_normal_map_y, + occlusion_texture: base.occlusion_texture.map(ProtoAsset::Handle), + double_sided: base.double_sided, + cull_mode: base.cull_mode.map(Into::into), + unlit: base.unlit, + fog_enabled: base.fog_enabled, + alpha_mode: base.alpha_mode, + depth_bias: base.depth_bias, + depth_map: base.depth_map.map(ProtoAsset::Handle), + parallax_depth_scale: base.parallax_depth_scale, + parallax_mapping_method: base.parallax_mapping_method, + max_parallax_layer_count: base.max_parallax_layer_count, + } + } +} + +impl FromSchematicInput for StandardMaterial { + fn from_input( + input: StandardMaterialInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { + Self { + base_color: input.base_color.into(), + base_color_texture: input.base_color_texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x0ec0883fecc74db5b30c8e7855f0aeed, + )), + context, + ) + }), + emissive: input.emissive.into(), + emissive_texture: input.emissive_texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x3f0b895dda574a55887cc32f9c20285a, + )), + context, + ) + }), + perceptual_roughness: input.perceptual_roughness, + metallic: input.metallic, + metallic_roughness_texture: input.metallic_roughness_texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0xd063b6d68c33437a9bd341be88d64c06, + )), + context, + ) + }), + reflectance: input.reflectance, + normal_map_texture: input.normal_map_texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x0ede476ee6994cf986f5a333bd385b62, + )), + context, + ) + }), + flip_normal_map_y: input.flip_normal_map_y, + occlusion_texture: input.occlusion_texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x19d7d9309c184fb58e31166652c5bee8, + )), + context, + ) + }), + double_sided: input.double_sided, + cull_mode: input.cull_mode.map(Into::into), + unlit: input.unlit, + fog_enabled: input.fog_enabled, + alpha_mode: input.alpha_mode, + depth_bias: input.depth_bias, + depth_map: input.depth_map.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x833fe20f1b7d4b469e9d6a86f873f7ae, + )), + context, + ) + }), + parallax_depth_scale: input.parallax_depth_scale, + parallax_mapping_method: input.parallax_mapping_method, + max_parallax_layer_count: input.max_parallax_layer_count, + } + } +} + +impl FromSchematicPreloadInput for StandardMaterial { + fn from_preload_input( + input: StandardMaterialInput, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self { + Self { + base_color: input.base_color.into(), + base_color_texture: input.base_color_texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x0ec0883fecc74db5b30c8e7855f0aeed, + )), + dependencies, + ) + }), + emissive: input.emissive.into(), + emissive_texture: input.emissive_texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x3f0b895dda574a55887cc32f9c20285a, + )), + dependencies, + ) + }), + perceptual_roughness: input.perceptual_roughness, + metallic: input.metallic, + metallic_roughness_texture: input.metallic_roughness_texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0xd063b6d68c33437a9bd341be88d64c06, + )), + dependencies, + ) + }), + reflectance: input.reflectance, + normal_map_texture: input.normal_map_texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x0ede476ee6994cf986f5a333bd385b62, + )), + dependencies, + ) + }), + flip_normal_map_y: input.flip_normal_map_y, + occlusion_texture: input.occlusion_texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x19d7d9309c184fb58e31166652c5bee8, + )), + dependencies, + ) + }), + double_sided: input.double_sided, + cull_mode: input.cull_mode.map(Into::into), + unlit: input.unlit, + fog_enabled: input.fog_enabled, + alpha_mode: input.alpha_mode, + depth_bias: input.depth_bias, + depth_map: input.depth_map.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x833fe20f1b7d4b469e9d6a86f873f7ae, + )), + dependencies, + ) + }), + parallax_depth_scale: input.parallax_depth_scale, + parallax_mapping_method: input.parallax_mapping_method, + max_parallax_layer_count: input.max_parallax_layer_count, + } + } +} + +#[derive(Reflect)] +pub enum FaceInput { + Front = 0, + Back = 1, +} + +impl From for Face { + fn from(value: FaceInput) -> Self { + match value { + FaceInput::Front => Face::Front, + FaceInput::Back => Face::Back, + } + } +} + +impl From for FaceInput { + fn from(value: Face) -> Self { + match value { + Face::Front => FaceInput::Front, + Face::Back => FaceInput::Back, + } + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render.rs b/bevy_proto_backend/src/impls/bevy_impls/render.rs deleted file mode 100644 index 13ef489..0000000 --- a/bevy_proto_backend/src/impls/bevy_impls/render.rs +++ /dev/null @@ -1,117 +0,0 @@ -use bevy::app::App; -use bevy::prelude::{Camera, Entity, OrthographicProjection, PerspectiveProjection, Projection}; -use bevy::reflect::{std_traits::ReflectDefault, Reflect}; -use bevy::render::camera::CameraRenderGraph; -use bevy::render::mesh::skinning::SkinnedMesh; -use bevy::render::primitives::Aabb; -use bevy::render::view::{ColorGrading, RenderLayers, Visibility}; - -use crate::impls::macros::{from_to_default, register_schematic}; -use crate::tree::ProtoEntityList; -use bevy_proto_derive::impl_external_schematic; - -pub(super) fn register(app: &mut App) { - register_schematic!( - app, - Aabb, - Camera, - CameraRenderGraph, - ColorGrading, - OrthographicProjection, - PerspectiveProjection, - Projection, - RenderLayers, - SkinnedMesh, - Visibility, - ); -} - -impl_external_schematic! { - struct Aabb {} -} - -impl_external_schematic! { - struct Camera {} -} - -impl_external_schematic! { - struct CameraRenderGraph {} -} - -impl_external_schematic! { - #[schematic(from = ColorGradingInput)] - struct ColorGrading {} - // --- - #[derive(Reflect)] - #[reflect(Default)] - pub struct ColorGradingInput { - pub exposure: f32, - pub gamma: f32, - pub pre_saturation: f32, - pub post_saturation: f32, - } - from_to_default! { - ColorGrading, - ColorGradingInput, - |value: Input| Self { - exposure: value.exposure, - gamma: value.gamma, - pre_saturation: value.pre_saturation, - post_saturation: value.post_saturation, - } - } -} - -impl_external_schematic! { - struct OrthographicProjection {} -} - -impl_external_schematic! { - struct PerspectiveProjection {} -} - -impl_external_schematic! { - #[schematic(from = ProjectionInput)] - enum Projection {} - // --- - #[derive(Reflect)] - #[reflect(Default)] - pub enum ProjectionInput { - Perspective(PerspectiveProjection), - Orthographic(OrthographicProjection), - } - from_to_default! { - Projection, - ProjectionInput, - |value: Input| match value { - Input::Perspective(projection) => Self::Perspective(projection), - Input::Orthographic(projection) => Self::Orthographic(projection), - } - } -} - -impl_external_schematic! { - #[schematic(from = RenderLayersInput)] - struct RenderLayers(); - // --- - #[derive(Reflect)] - pub struct RenderLayersInput(u8); - impl From for RenderLayers { - fn from(value: RenderLayersInput) -> Self { - Self::layer(value.0) - } - } -} - -impl_external_schematic! { - pub struct SkinnedMesh { - #[schematic(asset(lazy))] - pub inverse_bindposes: Handle, - #[schematic(from = ProtoEntityList)] - pub joints: Vec, - } -} - -impl_external_schematic! { - enum Visibility {} -} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/mod.rs b/bevy_proto_backend/src/impls/bevy_impls/render/mod.rs new file mode 100644 index 0000000..34e58c0 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/mod.rs @@ -0,0 +1,5 @@ +pub use registrations::*; +pub use shapes::*; + +mod registrations; +mod shapes; diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/registrations.rs b/bevy_proto_backend/src/impls/bevy_impls/render/registrations.rs new file mode 100644 index 0000000..af71c6b --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/registrations.rs @@ -0,0 +1,188 @@ +use bevy::app::App; +use bevy::math::Mat4; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::camera::{ + Camera, CameraRenderGraph, OrthographicProjection, PerspectiveProjection, Projection, +}; +use bevy::render::mesh::shape::{ + Box, Capsule, Circle, Cube, Cylinder, Icosphere, Plane, Quad, RegularPolygon, Torus, UVSphere, +}; +use bevy::render::mesh::skinning::{SkinnedMesh, SkinnedMeshInverseBindposes}; +use bevy::render::mesh::Mesh; +use bevy::render::primitives::Aabb; +use bevy::render::view::{ColorGrading, RenderLayers, Visibility}; + +use crate::assets::AssetSchematicAppExt; +use bevy_proto_derive::{impl_external_asset_schematic, impl_external_schematic}; + +use crate::impls::macros::{from_to_default, register_schematic}; +use crate::tree::ProtoEntityList; + +use super::shapes::*; + +pub(crate) fn register(app: &mut App) { + register_schematic!( + app, + Aabb, + Camera, + CameraRenderGraph, + ColorGrading, + OrthographicProjection, + PerspectiveProjection, + Projection, + RenderLayers, + SkinnedMesh, + Visibility, + ); + + app.register_asset_schematic::() + .register_asset_schematic::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::() + .register_type::(); +} + +impl_external_schematic! { + struct Aabb {} +} + +impl_external_schematic! { + struct Camera {} +} + +impl_external_schematic! { + struct CameraRenderGraph {} +} + +impl_external_schematic! { + #[schematic(from = ColorGradingInput)] + struct ColorGrading {} + // --- + #[derive(Reflect)] + #[reflect(Default)] + pub struct ColorGradingInput { + pub exposure: f32, + pub gamma: f32, + pub pre_saturation: f32, + pub post_saturation: f32, + } + from_to_default! { + ColorGrading, + ColorGradingInput, + |value: Input| Self { + exposure: value.exposure, + gamma: value.gamma, + pre_saturation: value.pre_saturation, + post_saturation: value.post_saturation, + } + } +} + +impl_external_schematic! { + struct OrthographicProjection {} +} + +impl_external_schematic! { + struct PerspectiveProjection {} +} + +impl_external_schematic! { + #[schematic(from = ProjectionInput)] + enum Projection {} + // --- + #[derive(Reflect)] + #[reflect(Default)] + pub enum ProjectionInput { + Perspective(PerspectiveProjection), + Orthographic(OrthographicProjection), + } + from_to_default! { + Projection, + ProjectionInput, + |value: Input| match value { + Input::Perspective(projection) => Self::Perspective(projection), + Input::Orthographic(projection) => Self::Orthographic(projection), + } + } +} + +impl_external_schematic! { + #[schematic(from = RenderLayersInput)] + struct RenderLayers(); + // --- + #[derive(Reflect)] + pub struct RenderLayersInput(u8); + impl From for RenderLayers { + fn from(value: RenderLayersInput) -> Self { + Self::layer(value.0) + } + } +} + +impl_external_schematic! { + pub struct SkinnedMesh { + #[schematic(asset(inline))] + pub inverse_bindposes: Handle, + #[schematic(from = ProtoEntityList)] + pub joints: Vec, + } +} + +impl_external_schematic! { + enum Visibility {} +} + +// === Assets === // + +impl_external_asset_schematic! { + #[asset_schematic(from = Vec)] + struct SkinnedMeshInverseBindposes {} +} + +impl_external_asset_schematic! { + #[asset_schematic(from = MeshInput)] + struct Mesh {} +} + +/// The schematic input type for [`Mesh`]. +#[derive(Reflect)] +pub enum MeshInput { + Box(BoxInput), + Capsule(CapsuleInput), + Circle(CircleInput), + Cube(CubeInput), + Cylinder(CylinderInput), + Icosphere(IcosphereInput), + Plane(PlaneInput), + Quad(QuadInput), + RegularPolygon(RegularPolygonInput), + Torus(TorusInput), + UvSphere(UVSphereInput), +} + +impl From for Mesh { + fn from(value: MeshInput) -> Self { + match value { + MeshInput::Box(input) => Box::from(input).into(), + MeshInput::Capsule(input) => Capsule::from(input).into(), + MeshInput::Circle(input) => Circle::from(input).into(), + MeshInput::Cube(input) => Cube::from(input).into(), + MeshInput::Cylinder(input) => Cylinder::from(input).into(), + MeshInput::Icosphere(input) => Icosphere::from(input).try_into().unwrap(), + MeshInput::Plane(input) => Plane::from(input).into(), + MeshInput::Quad(input) => Quad::from(input).into(), + MeshInput::RegularPolygon(input) => RegularPolygon::from(input).into(), + MeshInput::Torus(input) => Torus::from(input).into(), + MeshInput::UvSphere(input) => UVSphere::from(input).into(), + } + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/boxes.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/boxes.rs new file mode 100644 index 0000000..0e32af0 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/boxes.rs @@ -0,0 +1,42 @@ +use bevy::math::Vec3; +use bevy::reflect::Reflect; +use bevy::render::mesh::shape::Box; + +/// The schematic input type for [`Box`]. +#[derive(Reflect)] +pub enum BoxInput { + Size(Vec3), + Corners(Vec3, Vec3), +} + +impl Default for BoxInput { + fn default() -> Self { + Box::default().into() + } +} + +impl From for Box { + fn from(value: BoxInput) -> Self { + match value { + BoxInput::Size(size) => Box::new(size.x, size.y, size.z), + BoxInput::Corners(a, b) => Box::from_corners(a, b), + } + } +} + +impl From for BoxInput { + fn from(value: Box) -> Self { + let Box { + min_x, + min_y, + min_z, + max_x, + max_y, + max_z, + } = value; + Self::Corners( + Vec3::new(min_x, min_y, min_z), + Vec3::new(max_x, max_y, max_z), + ) + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/capsules.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/capsules.rs new file mode 100644 index 0000000..bd4bd8d --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/capsules.rs @@ -0,0 +1,55 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::{Capsule, CapsuleUvProfile}; + +/// The schematic input type for [`Capsule`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct CapsuleInput { + /// Radius on the `XZ` plane. + pub radius: f32, + /// Number of sections in cylinder between hemispheres. + pub rings: usize, + /// Height of the middle cylinder on the `Y` axis, excluding the hemispheres. + pub depth: f32, + /// Number of latitudes, distributed by inclination. Must be even. + pub latitudes: usize, + /// Number of longitudes, or meridians, distributed by azimuth. + pub longitudes: usize, + /// Manner in which UV coordinates are distributed vertically. + pub uv_profile: CapsuleUvProfileInput, +} + +/// The schematic input type for [`CapsuleUvProfile`]. +#[derive(Reflect, Copy, Clone)] +pub enum CapsuleUvProfileInput { + Aspect, + /// Hemispheres get UV space according to the ratio of latitudes to rings. + Uniform, + /// Upper third of the texture goes to the northern hemisphere, middle third to the cylinder + /// and lower third to the southern one. + Fixed, +} + +from_to_default! { + CapsuleUvProfile, + CapsuleUvProfileInput, + |value: Input| match value { + Input::Aspect => Self::Aspect, + Input::Uniform => Self::Uniform, + Input::Fixed => Self::Fixed, + } +} + +from_to_default! { + Capsule, + CapsuleInput, + |value: Input| Self { + radius: value.radius, + rings: value.rings, + depth: value.depth, + latitudes: value.latitudes, + longitudes: value.longitudes, + uv_profile: value.uv_profile.into(), + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/circles.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/circles.rs new file mode 100644 index 0000000..fe90a63 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/circles.rs @@ -0,0 +1,22 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Circle; + +/// The schematic input type for [`Circle`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct CircleInput { + /// Inscribed radius in the `XY` plane. + pub radius: f32, + /// The number of vertices used. + pub vertices: usize, +} + +from_to_default! { + Circle, + CircleInput, + |value: Input| Self { + radius: value.radius, + vertices: value.vertices, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cubes.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cubes.rs new file mode 100644 index 0000000..d426960 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cubes.rs @@ -0,0 +1,18 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Cube; + +/// The schematic input type for [`Cube`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct CubeInput { + pub size: f32, +} + +from_to_default! { + Cube, + CubeInput, + |value: Input| Self { + size: value.size, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cylinders.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cylinders.rs new file mode 100644 index 0000000..8e81ab9 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/cylinders.rs @@ -0,0 +1,32 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Cylinder; + +/// The schematic input type for [`Cylinder`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct CylinderInput { + /// Radius in the XZ plane. + pub radius: f32, + /// Height of the cylinder in the Y axis. + pub height: f32, + /// The number of vertices around each horizontal slice of the cylinder. If you are looking at the cylinder from + /// above, this is the number of points you will see on the circle. + /// A higher number will make it appear more circular. + pub resolution: u32, + /// The number of segments between the two ends. Setting this to 1 will have triangles spanning the full + /// height of the cylinder. Setting it to 2 will have two sets of triangles with a horizontal slice in the middle of + /// cylinder. Greater numbers increase triangles/slices in the same way. + pub segments: u32, +} + +from_to_default! { + Cylinder, + CylinderInput, + |value: Input| Self { + radius: value.radius, + height: value.height, + resolution: value.resolution, + segments: value.segments, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/mod.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/mod.rs new file mode 100644 index 0000000..5d22ec5 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/mod.rs @@ -0,0 +1,21 @@ +pub use boxes::*; +pub use capsules::*; +pub use circles::*; +pub use cubes::*; +pub use cylinders::*; +pub use planes::*; +pub use polygons::*; +pub use quads::*; +pub use spheres::*; +pub use toruses::*; + +mod boxes; +mod capsules; +mod circles; +mod cubes; +mod cylinders; +mod planes; +mod polygons; +mod quads; +mod spheres; +mod toruses; diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/planes.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/planes.rs new file mode 100644 index 0000000..4600985 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/planes.rs @@ -0,0 +1,30 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Plane; + +/// The schematic input type for [`Plane`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct PlaneInput { + /// The total side length of the square. + pub size: f32, + /// The number of subdivisions in the mesh. + /// + /// 0 - is the original plane geometry, the 4 points in the XZ plane. + /// + /// 1 - is split by 1 line in the middle of the plane on both the X axis and the Z axis, resulting in a plane with 4 quads / 8 triangles. + /// + /// 2 - is a plane split by 2 lines on both the X and Z axes, subdividing the plane into 3 equal sections along each axis, resulting in a plane with 9 quads / 18 triangles. + /// + /// and so on... + pub subdivisions: u32, +} + +from_to_default! { + Plane, + PlaneInput, + |value: Input| Self { + size: value.size, + subdivisions: value.subdivisions, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/polygons.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/polygons.rs new file mode 100644 index 0000000..2e2cc2d --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/polygons.rs @@ -0,0 +1,24 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::RegularPolygon; + +/// The schematic input type for [`RegularPolygon`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct RegularPolygonInput { + /// Circumscribed radius in the `XY` plane. + /// + /// In other words, the vertices of this polygon will all touch a circle of this radius. + pub radius: f32, + /// Number of sides. + pub sides: usize, +} + +from_to_default! { + RegularPolygon, + RegularPolygonInput, + |value: Input| Self { + radius: value.radius, + sides: value.sides, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/quads.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/quads.rs new file mode 100644 index 0000000..12f565e --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/quads.rs @@ -0,0 +1,23 @@ +use crate::from_to_default; +use bevy::math::Vec2; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Quad; + +/// The schematic input type for [`Quad`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct QuadInput { + /// Full width and height of the rectangle. + pub size: Vec2, + /// Horizontally-flip the texture coordinates of the resulting mesh. + pub flip: bool, +} + +from_to_default! { + Quad, + QuadInput, + |value: Input| Self { + size: value.size, + flip: value.flip, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/spheres.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/spheres.rs new file mode 100644 index 0000000..7449cc5 --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/spheres.rs @@ -0,0 +1,42 @@ +use crate::from_to_default; +use bevy::prelude::shape::Icosphere; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::UVSphere; + +/// The schematic input type for [`UVSphere`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct UVSphereInput { + pub radius: f32, + pub sectors: usize, + pub stacks: usize, +} + +from_to_default! { + UVSphere, + UVSphereInput, + |value: Input| Self { + radius: value.radius, + sectors: value.sectors, + stacks: value.stacks, + } +} + +/// The schematic input type for [`Icosphere`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct IcosphereInput { + /// The radius of the sphere. + pub radius: f32, + /// The number of subdivisions applied. + pub subdivisions: usize, +} + +from_to_default! { + Icosphere, + IcosphereInput, + |value: Input| Self { + radius: value.radius, + subdivisions: value.subdivisions, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/render/shapes/toruses.rs b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/toruses.rs new file mode 100644 index 0000000..8565e3d --- /dev/null +++ b/bevy_proto_backend/src/impls/bevy_impls/render/shapes/toruses.rs @@ -0,0 +1,24 @@ +use crate::from_to_default; +use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::render::mesh::shape::Torus; + +/// The schematic input type for [`Torus`]. +#[derive(Reflect, Copy, Clone)] +#[reflect(Default)] +pub struct TorusInput { + pub radius: f32, + pub ring_radius: f32, + pub subdivisions_segments: usize, + pub subdivisions_sides: usize, +} + +from_to_default! { + Torus, + TorusInput, + |value: Input| Self { + radius: value.radius, + ring_radius: value.ring_radius, + subdivisions_segments: value.subdivisions_segments, + subdivisions_sides: value.subdivisions_sides, + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/sprite.rs b/bevy_proto_backend/src/impls/bevy_impls/sprite.rs index 315b0ca..4bf8bff 100644 --- a/bevy_proto_backend/src/impls/bevy_impls/sprite.rs +++ b/bevy_proto_backend/src/impls/bevy_impls/sprite.rs @@ -1,14 +1,25 @@ use bevy::app::App; -use bevy::math::Vec2; +use bevy::math::{Rect, Vec2}; +use bevy::prelude::{Color, Image}; use bevy::reflect::{std_traits::ReflectDefault, Reflect}; -use bevy::sprite::{Anchor, Mesh2dHandle, Sprite, TextureAtlasSprite}; +use bevy::render::prelude::Mesh; +use bevy::sprite::{Anchor, ColorMaterial, Mesh2dHandle, Sprite, TextureAtlas, TextureAtlasSprite}; +use bevy::utils::HashMap; +use crate::assets::{AssetSchematicAppExt, InlinableProtoAsset, ProtoAsset}; +use crate::deps::DependenciesBuilder; use crate::impls::macros::{from_to_default, register_schematic}; -use crate::proto::{ProtoAsset, ProtoColor}; -use bevy_proto_derive::impl_external_schematic; +use crate::proto::ProtoColor; +use crate::schematics::{ + FromSchematicInput, FromSchematicPreloadInput, SchematicContext, SchematicId, +}; +use bevy_proto_derive::{impl_external_asset_schematic, impl_external_schematic}; pub(super) fn register(app: &mut App) { register_schematic!(app, Anchor, Mesh2dHandle, Sprite, TextureAtlasSprite); + + app.register_asset_schematic::() + .register_asset_schematic::(); } impl_external_schematic! { @@ -17,12 +28,12 @@ impl_external_schematic! { impl_external_schematic! { #[schematic(input(vis = pub))] - struct Mesh2dHandle(#[schematic(asset)] pub Handle); + struct Mesh2dHandle(#[schematic(asset(inline))] pub Handle); // --- + #[allow(clippy::derivable_impls)] impl Default for Mesh2dHandleInput { fn default() -> Self { - let base = ::default(); - Self(ProtoAsset::HandleId(base.0.id())) + Self(InlinableProtoAsset::default()) } } } @@ -58,3 +69,158 @@ impl_external_schematic! { } } } + +// === Assets === // + +impl_external_asset_schematic! { + #[asset_schematic(from = ColorMaterialInput)] + struct ColorMaterial {} +} + +/// The schematic input type for [`ColorMaterial`]. +#[derive(Reflect)] +#[reflect(Default)] +pub struct ColorMaterialInput { + pub color: Color, + pub texture: Option>, +} + +impl FromSchematicInput for ColorMaterial { + fn from_input( + input: ColorMaterialInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { + Self { + color: input.color, + texture: input.texture.map(|value| { + FromSchematicInput::from_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x6df96d568e7642c8bc7b9274ef732591, + )), + context, + ) + }), + } + } +} + +impl FromSchematicPreloadInput for ColorMaterial { + fn from_preload_input( + input: ColorMaterialInput, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self { + Self { + color: input.color, + texture: input.texture.map(|value| { + FromSchematicPreloadInput::from_preload_input( + value, + id.next(bevy::utils::Uuid::from_u128( + 0x6df96d568e7642c8bc7b9274ef732591, + )), + dependencies, + ) + }), + } + } +} + +impl Default for ColorMaterialInput { + fn default() -> Self { + let base = ColorMaterial::default(); + Self { + color: base.color, + texture: base.texture.map(ProtoAsset::from), + } + } +} + +impl_external_asset_schematic! { + #[asset_schematic(from = TextureAtlasInput)] + struct TextureAtlas {} +} + +/// The schematic input type for [`TextureAtlas`]. +#[derive(Reflect)] +pub struct TextureAtlasInput { + pub texture: ProtoAsset, + pub size: Vec2, + pub textures: Vec, + pub texture_handles: Option, usize>>, +} + +impl FromSchematicInput for TextureAtlas { + fn from_input( + input: TextureAtlasInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { + Self { + texture: FromSchematicInput::from_input( + input.texture, + id.next(bevy::utils::Uuid::from_u128( + 0x9d0bb563b0fe45d689404b63567c597b, + )), + context, + ), + size: input.size, + textures: input.textures, + texture_handles: input.texture_handles.map(|value| { + value + .into_iter() + .map(|(key, value)| { + ( + FromSchematicInput::from_input( + key, + id.next(bevy::utils::Uuid::from_u128( + 0xccb7edfefe6e4a92ab42c7c7e87e3afa, + )), + context, + ), + value, + ) + }) + .collect() + }), + } + } +} + +impl FromSchematicPreloadInput for TextureAtlas { + fn from_preload_input( + input: TextureAtlasInput, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self { + Self { + texture: FromSchematicPreloadInput::from_preload_input( + input.texture, + id.next(bevy::utils::Uuid::from_u128( + 0x9d0bb563b0fe45d689404b63567c597b, + )), + dependencies, + ), + size: input.size, + textures: input.textures, + texture_handles: input.texture_handles.map(|value| { + value + .into_iter() + .map(|(key, value)| { + ( + FromSchematicPreloadInput::from_preload_input( + key, + id.next(bevy::utils::Uuid::from_u128( + 0xccb7edfefe6e4a92ab42c7c7e87e3afa, + )), + dependencies, + ), + value, + ) + }) + .collect() + }), + } + } +} diff --git a/bevy_proto_backend/src/impls/bevy_impls/text.rs b/bevy_proto_backend/src/impls/bevy_impls/text.rs index 3ac42a0..ca49667 100644 --- a/bevy_proto_backend/src/impls/bevy_impls/text.rs +++ b/bevy_proto_backend/src/impls/bevy_impls/text.rs @@ -1,14 +1,18 @@ use bevy::app::App; use bevy::math::Vec2; +use bevy::prelude::Font; use bevy::reflect::{std_traits::ReflectDefault, Reflect}; +use bevy::sprite::TextureAtlas; use bevy::text::{ BreakLineOn, GlyphAtlasInfo, PositionedGlyph, Text, Text2dBounds, TextAlignment, TextLayoutInfo, TextSection, TextStyle, }; use crate::impls::macros::{from_to_default, from_to_input, register_schematic}; -use crate::proto::{ProtoAsset, ProtoColor}; -use crate::schematics::{FromSchematicInput, SchematicContext}; +use crate::proto::ProtoColor; +use crate::schematics::{FromSchematicInput, SchematicContext, SchematicId}; + +use crate::assets::ProtoAsset; use bevy_proto_derive::impl_external_schematic; pub(super) fn register(app: &mut App) { @@ -34,10 +38,14 @@ impl_external_schematic! { from_to_input! { Text, TextInput, - move |input: Input, context: &mut SchematicContext| { + move |input: Input, id: SchematicId, context: &mut SchematicContext| { let mut sections = Vec::with_capacity(input.sections.len()); for section in input.sections { - sections.push(FromSchematicInput::from_input(section, &mut *context)); + sections.push(FromSchematicInput::from_input( + section, + id.next(bevy::utils::Uuid::from_u128(0x529d5df317584b1dbede8eb45d2e2144)), + &mut *context + )); } Self { @@ -66,23 +74,31 @@ impl_external_schematic! { from_to_input! { TextSection, TextSectionInput, - |input: Input, context| Self { + |input: Input, id: SchematicId, context| Self { value: input.value, - style: FromSchematicInput::from_input(input.style, context) + style: FromSchematicInput::from_input( + input.style, + id.next(bevy::utils::Uuid::from_u128(0x1526927b34b34337b4141868f98d52cd)), + context + ) } } #[derive(Reflect)] pub struct TextStyleInput { - pub font: ProtoAsset, + pub font: ProtoAsset, pub font_size: f32, pub color: ProtoColor, } from_to_input! { TextStyle, TextStyleInput, - |input: Input, context| Self { - font: FromSchematicInput::from_input(input.font, context), + |input: Input, id: SchematicId, context| Self { + font: FromSchematicInput::from_input( + input.font, + id.next(bevy::utils::Uuid::from_u128(0xeae7ac5b229c4f58883dfc11bb02031b)), + context + ), font_size: input.font_size, color: input.color.into(), } @@ -115,12 +131,19 @@ pub struct TextLayoutInfoInput { } impl FromSchematicInput for TextLayoutInfo { - fn from_input(input: TextLayoutInfoInput, context: &mut SchematicContext) -> Self { + fn from_input( + input: TextLayoutInfoInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { Self { glyphs: input .glyphs .into_iter() - .map(|glyph| FromSchematicInput::from_input(glyph, context)) + .enumerate() + .map(|(index, glyph)| { + FromSchematicInput::from_input(glyph, id.next(index), context) + }) .collect(), size: input.size, } @@ -137,11 +160,15 @@ pub struct PositionedGlyphInput { } impl FromSchematicInput for PositionedGlyph { - fn from_input(input: PositionedGlyphInput, context: &mut SchematicContext) -> Self { + fn from_input( + input: PositionedGlyphInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { Self { position: input.position, size: input.size, - atlas_info: FromSchematicInput::from_input(input.atlas_info, context), + atlas_info: FromSchematicInput::from_input(input.atlas_info, id, context), section_index: input.section_index, byte_index: input.byte_index, } @@ -150,14 +177,18 @@ impl FromSchematicInput for PositionedGlyph { #[derive(Reflect)] pub struct GlyphAtlasInfoInput { - pub texture_atlas: ProtoAsset, + pub texture_atlas: ProtoAsset, pub glyph_index: usize, } impl FromSchematicInput for GlyphAtlasInfo { - fn from_input(input: GlyphAtlasInfoInput, context: &mut SchematicContext) -> Self { + fn from_input( + input: GlyphAtlasInfoInput, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { Self { - texture_atlas: FromSchematicInput::from_input(input.texture_atlas, context), + texture_atlas: FromSchematicInput::from_input(input.texture_atlas, id, context), glyph_index: input.glyph_index, } } diff --git a/bevy_proto_backend/src/impls/bevy_impls/ui.rs b/bevy_proto_backend/src/impls/bevy_impls/ui.rs index 2e3155a..52b3622 100644 --- a/bevy_proto_backend/src/impls/bevy_impls/ui.rs +++ b/bevy_proto_backend/src/impls/bevy_impls/ui.rs @@ -1,6 +1,6 @@ use bevy::app::App; use bevy::math::{Rect, Vec2}; -use bevy::prelude::{BackgroundColor, Button, Label}; +use bevy::prelude::{BackgroundColor, Button, Image, Label}; use bevy::reflect::{std_traits::ReflectDefault, Reflect}; use bevy::ui::widget::TextFlags; use bevy::ui::{ @@ -10,8 +10,9 @@ use bevy::ui::{ PositionType, RelativeCursorPosition, RepeatedGridTrack, Style, UiImage, UiRect, Val, ZIndex, }; +use crate::assets::ProtoAsset; use crate::impls::macros::{from_to_default, register_schematic}; -use crate::proto::{ProtoAsset, ProtoColor}; +use crate::proto::ProtoColor; use bevy_proto_derive::impl_external_schematic; pub(super) fn register(app: &mut App) { @@ -257,7 +258,7 @@ impl_external_schematic! { impl_external_schematic! { #[schematic(input(vis = pub))] pub struct UiImage { - #[schematic(asset(lazy))] + #[schematic(asset)] pub texture: Handle, #[reflect(default)] pub flip_x: bool, @@ -269,7 +270,7 @@ impl_external_schematic! { fn default() -> Self { let base = UiImage::default(); Self { - texture: ProtoAsset::HandleId(base.texture.id()), + texture: ProtoAsset::Handle(base.texture.clone_weak()), flip_x: base.flip_x, flip_y: base.flip_y, } diff --git a/bevy_proto_backend/src/impls/macros.rs b/bevy_proto_backend/src/impls/macros.rs index 72dc3e8..9007b72 100644 --- a/bevy_proto_backend/src/impls/macros.rs +++ b/bevy_proto_backend/src/impls/macros.rs @@ -79,10 +79,11 @@ macro_rules! from_to_input { impl $crate::schematics::FromSchematicInput for $mock { fn from_input( input: Input, + id: $crate::schematics::SchematicId, context: &mut $crate::schematics::SchematicContext, ) -> Self { #[allow(clippy::redundant_closure_call)] - $body(input, context) + $body(input, id, context) } } }; @@ -93,10 +94,11 @@ macro_rules! from_to_input { impl $crate::schematics::FromSchematicInput for $real { fn from_input( input: Input, + id: $crate::schematics::SchematicId, context: &mut $crate::schematics::SchematicContext, ) -> Self { #[allow(clippy::redundant_closure_call)] - $body(input, context) + $body(input, id, context) } } }; diff --git a/bevy_proto_backend/src/lib.rs b/bevy_proto_backend/src/lib.rs index d00db0f..75e5546 100644 --- a/bevy_proto_backend/src/lib.rs +++ b/bevy_proto_backend/src/lib.rs @@ -1,9 +1,9 @@ pub use plugin::*; +pub mod assets; pub mod children; pub mod cycles; pub mod deps; -#[doc(hidden)] pub mod impls; pub mod load; pub mod path; diff --git a/bevy_proto_backend/src/load/load_context.rs b/bevy_proto_backend/src/load/load_context.rs index 021323a..105a3f7 100644 --- a/bevy_proto_backend/src/load/load_context.rs +++ b/bevy_proto_backend/src/load/load_context.rs @@ -12,6 +12,7 @@ use crate::deps::DependenciesBuilder; use crate::load::{Loader, ProtoLoadMeta}; use crate::path::ProtoPathContext; use crate::proto::Prototypical; +use crate::schematics::SchematicId; /// The context when loading a [prototype]. /// @@ -145,7 +146,8 @@ impl<'a, 'ctx, T: Prototypical, L: Loader> ProtoLoadContext<'a, 'ctx, T, L> { // 1. Track schematic dependencies for (_, schematic) in prototype.schematics_mut().iter_mut() { - schematic.preload_dependencies(&mut deps)?; + let id = SchematicId::new(meta.handle.id(), schematic.type_info().type_id()); + schematic.preload_dependencies(id, &mut deps)?; } prototype.dependencies_mut().combine(deps.build()); diff --git a/bevy_proto_backend/src/plugin.rs b/bevy_proto_backend/src/plugin.rs index 3f5a415..384c7ad 100644 --- a/bevy_proto_backend/src/plugin.rs +++ b/bevy_proto_backend/src/plugin.rs @@ -1,5 +1,6 @@ use std::marker::PhantomData; +use crate::assets::ProtoAssetEvent; use bevy::app::{App, Plugin}; use bevy::asset::AddAsset; use bevy::prelude::{FromWorld, Update}; @@ -7,7 +8,7 @@ use parking_lot::Mutex; use crate::impls; use crate::load::{Loader, ProtoAssetLoader}; -use crate::proto::{Config, ProtoAsset, ProtoAssetEvent, ProtoStorage, Prototypical}; +use crate::proto::{Config, ProtoStorage, Prototypical}; use crate::registration::{on_proto_asset_event, ProtoRegistry}; use crate::tree::{AccessOp, ChildAccess, EntityAccess, ProtoEntity}; @@ -48,9 +49,9 @@ impl, C: Config> Plugin for ProtoBackendPlugin< #[cfg(feature = "bevy_render")] app.register_type::(); - app.register_type::() - .register_type::() + app.register_type::() .register_type::() + .register_type::>() .register_type::() .register_type::(); impls::register_impls(app); diff --git a/bevy_proto_backend/src/proto/assets.rs b/bevy_proto_backend/src/proto/assets.rs deleted file mode 100644 index b2e12bb..0000000 --- a/bevy_proto_backend/src/proto/assets.rs +++ /dev/null @@ -1,39 +0,0 @@ -use bevy::asset::{Asset, AssetPath, Handle, HandleId}; -use bevy::prelude::Reflect; - -/// Replacement type for asset handles in a [`Schematic::Input`] generated by the -/// [derive macro]. -/// -/// [`Schematic::Input`]: crate::schematics::Schematic::Input -/// [derive macro]: bevy_proto_derive::Schematic -#[derive(Clone, Debug, Eq, PartialEq, Hash, Reflect)] -pub enum ProtoAsset { - /// The path to an asset relative to the `assets` directory. - AssetPath(String), - /// An existing [`HandleId`]. - HandleId(HandleId), -} - -impl ProtoAsset { - /// Returns the [`AssetPath`] pointed to by this enum, if any. - pub fn to_asset_path(&self) -> Option> { - match self { - ProtoAsset::AssetPath(path) => Some(AssetPath::from(path)), - ProtoAsset::HandleId(_) => None, - } - } - - /// Returns a [`ProtoAsset::HandleId`] containing a default [`Handle`] for `T`. - /// - /// This can be used as `#[reflect(default = "ProtoAsset::default_handle_id::")]` - /// to denote a default value for a [`ProtoAsset`] field. - pub fn default_handle_id() -> Self { - Self::HandleId(Handle::::default().id()) - } -} - -impl From> for ProtoAsset { - fn from(value: Handle) -> Self { - Self::HandleId(value.id()) - } -} diff --git a/bevy_proto_backend/src/proto/commands.rs b/bevy_proto_backend/src/proto/commands.rs index 96520f7..4660cbd 100644 --- a/bevy_proto_backend/src/proto/commands.rs +++ b/bevy_proto_backend/src/proto/commands.rs @@ -6,7 +6,7 @@ use bevy::prelude::{Commands, Entity, Mut, World}; use crate::proto::{Config, Prototypical}; use crate::registration::ProtoRegistry; -use crate::schematics::{DynamicSchematic, SchematicContext}; +use crate::schematics::{DynamicSchematic, SchematicContext, SchematicId}; use crate::tree::EntityTreeNode; /// A system parameter similar to [`Commands`], but catered towards [prototypes]. @@ -190,8 +190,8 @@ impl> Command for ProtoInsertCommand { self.data.assert_is_registered(world); self.data - .for_each_schematic(world, true, |schematic, context| { - schematic.apply(context).unwrap(); + .for_each_schematic(world, true, |schematic, id, context| { + schematic.apply(id, context).unwrap(); }); } } @@ -221,8 +221,8 @@ impl> Command for ProtoRemoveCommand { self.data.assert_is_registered(world); self.data - .for_each_schematic(world, false, |schematic, context| { - schematic.remove(context).unwrap(); + .for_each_schematic(world, false, |schematic, id, context| { + schematic.remove(id, context).unwrap(); }); } } @@ -294,7 +294,7 @@ impl> ProtoCommandData { /// [prototype]: Prototypical fn for_each_schematic(&self, world: &mut World, is_apply: bool, callback: F) where - F: Fn(&DynamicSchematic, &mut SchematicContext), + F: Fn(&DynamicSchematic, SchematicId, &mut SchematicContext), { self.for_each_entity(world, is_apply, |node, context, prototypes, config| { let on_before_prototype = if is_apply { @@ -332,9 +332,11 @@ impl> ProtoCommandData { on_before_prototype(config, proto, context); for (_, schematic) in proto.schematics().iter() { - on_before_schematic(config, schematic, context); - callback(schematic, context); - on_after_schematic(config, schematic, context); + let id = SchematicId::new(*handle_id, schematic.type_info().type_id()); + + on_before_schematic(config, schematic, id.clone(), context); + callback(schematic, id.clone(), context); + on_after_schematic(config, schematic, id.clone(), context); } on_after_prototype(config, proto, context); diff --git a/bevy_proto_backend/src/proto/config.rs b/bevy_proto_backend/src/proto/config.rs index 81128ef..e55ba5d 100644 --- a/bevy_proto_backend/src/proto/config.rs +++ b/bevy_proto_backend/src/proto/config.rs @@ -3,7 +3,7 @@ use bevy::prelude::{FromWorld, Resource}; use crate::cycles::{Cycle, CycleResponse}; use crate::proto::Prototypical; -use crate::schematics::{DynamicSchematic, SchematicContext}; +use crate::schematics::{DynamicSchematic, SchematicContext, SchematicId}; /// Configuration for a [prototype]. /// @@ -87,6 +87,7 @@ pub trait Config: Resource + FromWorld { fn on_before_apply_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { } @@ -101,6 +102,7 @@ pub trait Config: Resource + FromWorld { fn on_after_apply_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { } @@ -115,6 +117,7 @@ pub trait Config: Resource + FromWorld { fn on_before_remove_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { } @@ -129,6 +132,7 @@ pub trait Config: Resource + FromWorld { fn on_after_remove_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { } diff --git a/bevy_proto_backend/src/proto/mod.rs b/bevy_proto_backend/src/proto/mod.rs index 1bcc0e0..1ebdcc5 100644 --- a/bevy_proto_backend/src/proto/mod.rs +++ b/bevy_proto_backend/src/proto/mod.rs @@ -1,25 +1,21 @@ //! The core of prototypes. -pub use assets::*; #[cfg(feature = "bevy_render")] pub use color::*; pub use commands::*; pub use component::*; pub use config::*; pub use error::*; -pub use event::*; pub use prototypes::*; pub use prototypical::*; pub(crate) use storage::*; -mod assets; #[cfg(feature = "bevy_render")] mod color; mod commands; mod component; mod config; mod error; -mod event; mod prototypes; mod prototypical; mod storage; diff --git a/bevy_proto_backend/src/registration/params.rs b/bevy_proto_backend/src/registration/params.rs index 6382178..cff6e6b 100644 --- a/bevy_proto_backend/src/registration/params.rs +++ b/bevy_proto_backend/src/registration/params.rs @@ -1,4 +1,5 @@ -use crate::proto::{Config, ProtoAssetEvent, ProtoError, Prototypical}; +use crate::assets::ProtoAssetEvent; +use crate::proto::{Config, ProtoError, Prototypical}; use bevy::asset::{Assets, Handle, HandleId}; use bevy::ecs::system::SystemParam; use bevy::prelude::{EventWriter, Res, ResMut}; diff --git a/bevy_proto_backend/src/registration/registry.rs b/bevy_proto_backend/src/registration/registry.rs index b1d2024..0f452ac 100644 --- a/bevy_proto_backend/src/registration/registry.rs +++ b/bevy_proto_backend/src/registration/registry.rs @@ -7,10 +7,11 @@ use crate::registration::params::RegistryParams; use bevy::asset::{Handle, HandleId}; use bevy::prelude::Resource; +use crate::assets::ProtoAssetEvent; use bevy::utils::{HashMap, HashSet}; use parking_lot::RwLock; -use crate::proto::{Config, ProtoAssetEvent, ProtoError, Prototypical}; +use crate::proto::{Config, ProtoError, Prototypical}; use crate::tree::{ProtoTree, ProtoTreeBuilder}; /// Resource used to track load states, store mappings, and generate cached data. diff --git a/bevy_proto_backend/src/schematics/dynamic.rs b/bevy_proto_backend/src/schematics/dynamic.rs index c5f0e40..8cd1562 100644 --- a/bevy_proto_backend/src/schematics/dynamic.rs +++ b/bevy_proto_backend/src/schematics/dynamic.rs @@ -5,7 +5,7 @@ use bevy::reflect::{FromType, GetTypeRegistration, TypeInfo, TypeRegistration, T use crate::deps::DependenciesBuilder; use crate::schematics::schematic::Schematic; -use crate::schematics::{SchematicContext, SchematicError}; +use crate::schematics::{SchematicContext, SchematicError, SchematicId}; /// A dynamic representation of a [`Schematic`]. /// @@ -44,21 +44,30 @@ impl DynamicSchematic { } /// Dynamically call the corresponding [`Schematic::apply`] method. - pub fn apply(&self, context: &mut SchematicContext) -> Result<(), SchematicError> { - (self.reflect_schematic.apply)(&*self.input, context) + pub fn apply( + &self, + id: SchematicId, + context: &mut SchematicContext, + ) -> Result<(), SchematicError> { + (self.reflect_schematic.apply)(&*self.input, id, context) } /// Dynamically call the corresponding [`Schematic::remove`] method. - pub fn remove(&self, context: &mut SchematicContext) -> Result<(), SchematicError> { - (self.reflect_schematic.remove)(&*self.input, context) + pub fn remove( + &self, + id: SchematicId, + context: &mut SchematicContext, + ) -> Result<(), SchematicError> { + (self.reflect_schematic.remove)(&*self.input, id, context) } /// Dynamically call the corresponding [`Schematic::preload_dependencies`] method. pub fn preload_dependencies( &mut self, + id: SchematicId, dependencies: &mut DependenciesBuilder, ) -> Result<(), SchematicError> { - (self.reflect_schematic.preload_dependencies)(&mut *self.input, dependencies) + (self.reflect_schematic.preload_dependencies)(&mut *self.input, id, dependencies) } /// The type info of the corresponding [`Schematic`]. @@ -101,10 +110,19 @@ pub struct ReflectSchematic { input_registration: fn() -> TypeRegistration, create_dynamic: fn(Box, ReflectSchematic) -> Result, - apply: fn(input: &dyn Reflect, context: &mut SchematicContext) -> Result<(), SchematicError>, - remove: fn(input: &dyn Reflect, context: &mut SchematicContext) -> Result<(), SchematicError>, + apply: fn( + input: &dyn Reflect, + id: SchematicId, + context: &mut SchematicContext, + ) -> Result<(), SchematicError>, + remove: fn( + input: &dyn Reflect, + id: SchematicId, + context: &mut SchematicContext, + ) -> Result<(), SchematicError>, preload_dependencies: fn( input: &mut dyn Reflect, + id: SchematicId, dependencies: &mut DependenciesBuilder, ) -> Result<(), SchematicError>, clone_input: fn(input: &dyn Reflect) -> Result, SchematicError>, @@ -149,27 +167,27 @@ impl FromType for ReflectSchematic { reflect_schematic: data, }) }, - apply: |reflect_input, context| { + apply: |reflect_input, id, context| { let input = reflect_input.downcast_ref::().ok_or_else(|| { SchematicError::TypeMismatch { expected: std::any::type_name::(), found: reflect_input.type_name().to_string(), } })?; - ::apply(input, context); + ::apply(input, id, context); Ok(()) }, - remove: |reflect_input, context| { + remove: |reflect_input, id, context| { let input = reflect_input.downcast_ref::().ok_or_else(|| { SchematicError::TypeMismatch { expected: std::any::type_name::(), found: reflect_input.type_name().to_string(), } })?; - ::remove(input, context); + ::remove(input, id, context); Ok(()) }, - preload_dependencies: |reflect_input, dependencies| { + preload_dependencies: |reflect_input, id, dependencies| { let type_name = reflect_input.type_name().to_string(); let input = reflect_input.downcast_mut::().ok_or_else(|| { SchematicError::TypeMismatch { @@ -177,7 +195,7 @@ impl FromType for ReflectSchematic { found: type_name, } })?; - ::preload_dependencies(input, dependencies); + ::preload_dependencies(input, id, dependencies); Ok(()) }, clone_input: |reflect_input| { diff --git a/bevy_proto_backend/src/schematics/id.rs b/bevy_proto_backend/src/schematics/id.rs new file mode 100644 index 0000000..a7d6767 --- /dev/null +++ b/bevy_proto_backend/src/schematics/id.rs @@ -0,0 +1,53 @@ +use bevy::asset::HandleId; +use bevy::utils::{AHasher, FixedState}; +use std::any::TypeId; +use std::hash::{BuildHasher, Hash, Hasher}; + +/// A unique identifier for a [`Schematic`]. +/// +/// This can be used to generate stable references for items in a `Schematic`, +/// including deeply nested items. +/// +/// This can be achieved by ensuring the same value is passed to [`SchematicId::next`]. +/// +/// [`Schematic`]: crate::schematics::Schematic +#[derive(Debug, Hash, PartialEq, Eq)] +pub struct SchematicId(u64); + +impl SchematicId { + /// Creates a new [`SchematicId`] from the given [`HandleId`] of the prototype asset + /// and the [`TypeId`] of the schematic itself. + pub(crate) fn new(proto: HandleId, schematic: TypeId) -> Self { + Self(Self::generate(|hasher| { + Hash::hash(&proto, hasher); + Hash::hash(&schematic, hasher); + })) + } + + /// The hash value of this [`SchematicId`]. + pub fn value(&self) -> u64 { + self.0 + } + + /// Generate a new [`SchematicId`] from this one and the given seed. + pub fn next(&self, seed: impl Hash) -> Self { + Self(Self::generate(|hasher| { + Hash::hash(self, hasher); + Hash::hash(&seed, hasher); + })) + } + + /// Allows cloning this [`SchematicId`]. + /// + /// This is used instead of the [`Clone`] trait to prevent consumers of this crate + /// from accidentally cloning this ID and subsequently breaking stability guarantees. + pub(crate) fn clone(&self) -> Self { + Self(self.0) + } + + fn generate(f: impl FnOnce(&mut AHasher)) -> u64 { + let mut hasher = FixedState.build_hasher(); + f(&mut hasher); + hasher.finish() + } +} diff --git a/bevy_proto_backend/src/schematics/mod.rs b/bevy_proto_backend/src/schematics/mod.rs index 9d5135f..4d1fcb5 100644 --- a/bevy_proto_backend/src/schematics/mod.rs +++ b/bevy_proto_backend/src/schematics/mod.rs @@ -42,10 +42,12 @@ pub use collection::*; pub use context::*; pub use dynamic::*; pub use error::*; +pub use id::*; pub use schematic::*; mod collection; mod context; mod dynamic; mod error; +mod id; mod schematic; diff --git a/bevy_proto_backend/src/schematics/schematic.rs b/bevy_proto_backend/src/schematics/schematic.rs index 371282a..d2d2d26 100644 --- a/bevy_proto_backend/src/schematics/schematic.rs +++ b/bevy_proto_backend/src/schematics/schematic.rs @@ -2,7 +2,7 @@ use bevy::prelude::{FromReflect, Reflect}; use bevy::reflect::{GetTypeRegistration, Typed}; use crate::deps::DependenciesBuilder; -use crate::schematics::SchematicContext; +use crate::schematics::{SchematicContext, SchematicId}; /// Trait used to create a [prototype] schematic for modifying an [entity] /// (or the [world] in general). @@ -15,19 +15,19 @@ use crate::schematics::SchematicContext; /// /// ``` /// use bevy::prelude::{Component, Reflect}; -/// use bevy_proto_backend::schematics::{Schematic, SchematicContext}; +/// use bevy_proto_backend::schematics::{Schematic, SchematicContext, SchematicId}; /// #[derive(Component, Reflect)] /// struct PlayerId(usize); /// /// impl Schematic for PlayerId { /// type Input = Self; /// -/// fn apply(input: &Self::Input, context: &mut SchematicContext) { -/// entity.insert(Self(input.0)); +/// fn apply(input: &Self::Input, id: SchematicId, context: &mut SchematicContext) { +/// context.entity_mut().unwrap().insert(Self(input.0)); /// } /// -/// fn remove(input: &Self::Input, context: &mut SchematicContext) { -/// entity.remove::(); +/// fn remove(input: &Self::Input, id: SchematicId, context: &mut SchematicContext) { +/// context.entity_mut().unwrap().remove::(); /// } /// } /// ``` @@ -48,19 +48,25 @@ pub trait Schematic: Reflect + Typed { type Input: FromReflect + GetTypeRegistration; /// Controls how this schematic is applied to the given entity. - fn apply(input: &Self::Input, context: &mut SchematicContext); + fn apply(input: &Self::Input, id: SchematicId, context: &mut SchematicContext); /// Controls how this schematic is removed from the given entity. - fn remove(input: &Self::Input, context: &mut SchematicContext); + fn remove(input: &Self::Input, id: SchematicId, context: &mut SchematicContext); /// Allows dependency assets to be loaded when this schematic is loaded. #[allow(unused_variables)] - fn preload_dependencies(input: &mut Self::Input, dependencies: &mut DependenciesBuilder) {} + fn preload_dependencies( + input: &mut Self::Input, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) { + // By default, do nothing. + } } /// A custom [`From`]-like trait used to convert the [input] of a [schematic] /// to itself. /// -/// This is used by [derive macro] to automatically handle the conversion. +/// This is used by the [derive macro] to automatically handle the conversion. /// /// This trait is has a blanket implementation for any type where the input /// type satisfies [`Into`] for the schematic type. @@ -69,11 +75,40 @@ pub trait Schematic: Reflect + Typed { /// [schematic]: Schematic /// [derive macro]: bevy_proto_derive::Schematic pub trait FromSchematicInput { - fn from_input(input: T, context: &mut SchematicContext) -> Self; + fn from_input(input: T, id: SchematicId, context: &mut SchematicContext) -> Self; } impl> FromSchematicInput for S { - fn from_input(input: T, _context: &mut SchematicContext) -> S { + fn from_input(input: T, _id: SchematicId, _context: &mut SchematicContext) -> S { + input.into() + } +} + +/// A custom [`From`]-like trait used to convert the [input] of a [schematic] +/// to itself during the _preload_ phase of a schematic. +/// +/// This is used by the [derive macro] to automatically handle the conversion. +/// +/// This trait is has a blanket implementation for any type where the input +/// type satisfies [`Into`] for the schematic type. +/// +/// [input]: Schematic::Input +/// [schematic]: Schematic +/// [derive macro]: bevy_proto_derive::Schematic +pub trait FromSchematicPreloadInput { + fn from_preload_input( + input: T, + id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) -> Self; +} + +impl> FromSchematicPreloadInput for S { + fn from_preload_input( + input: T, + _id: SchematicId, + _dependencies: &mut DependenciesBuilder, + ) -> Self { input.into() } } diff --git a/bevy_proto_backend/src/tree/access.rs b/bevy_proto_backend/src/tree/access.rs index df0e404..42e76c7 100644 --- a/bevy_proto_backend/src/tree/access.rs +++ b/bevy_proto_backend/src/tree/access.rs @@ -8,7 +8,7 @@ use bevy::prelude::Entity; use bevy::reflect::{std_traits::ReflectDefault, Reflect, ReflectDeserialize}; use serde::Deserialize; -use crate::schematics::{FromSchematicInput, SchematicContext}; +use crate::schematics::{FromSchematicInput, SchematicContext, SchematicId}; /// A deserializable prototype entity reference. /// @@ -343,7 +343,7 @@ impl> From for EntityAccess { } impl FromSchematicInput for Entity { - fn from_input(input: EntityAccess, context: &mut SchematicContext) -> Self { + fn from_input(input: EntityAccess, _id: SchematicId, context: &mut SchematicContext) -> Self { context .find_entity(&input) .unwrap_or_else(|| panic!("entity should exist at path {:?}", input.to_path())) @@ -351,7 +351,7 @@ impl FromSchematicInput for Entity { } impl FromSchematicInput for Entity { - fn from_input(input: ProtoEntity, context: &mut SchematicContext) -> Self { + fn from_input(input: ProtoEntity, _id: SchematicId, context: &mut SchematicContext) -> Self { let access: EntityAccess = input.into(); context .find_entity(&access) @@ -360,13 +360,13 @@ impl FromSchematicInput for Entity { } impl FromSchematicInput for Option { - fn from_input(input: EntityAccess, context: &mut SchematicContext) -> Self { + fn from_input(input: EntityAccess, _id: SchematicId, context: &mut SchematicContext) -> Self { context.find_entity(&input) } } impl FromSchematicInput for Option { - fn from_input(input: ProtoEntity, context: &mut SchematicContext) -> Self { + fn from_input(input: ProtoEntity, _id: SchematicId, context: &mut SchematicContext) -> Self { context.find_entity(&input.into()) } } @@ -393,7 +393,11 @@ impl FromSchematicInput for Option { pub struct ProtoEntityList(pub Vec); impl FromSchematicInput for Vec { - fn from_input(input: ProtoEntityList, context: &mut SchematicContext) -> Self { + fn from_input( + input: ProtoEntityList, + _id: SchematicId, + context: &mut SchematicContext, + ) -> Self { input .0 .into_iter() diff --git a/bevy_proto_derive/Cargo.toml b/bevy_proto_derive/Cargo.toml index abc6e01..fed4000 100644 --- a/bevy_proto_derive/Cargo.toml +++ b/bevy_proto_derive/Cargo.toml @@ -22,5 +22,6 @@ syn = "2.0" quote = "1.0" proc-macro2 = "1.0" proc-macro-crate = "1.3" +uuid = "1.3" optional-error = "0.1" to_phantom = "0.1" \ No newline at end of file diff --git a/bevy_proto_derive/src/asset_schematic/container_attributes.rs b/bevy_proto_derive/src/asset_schematic/container_attributes.rs new file mode 100644 index 0000000..20a0f8f --- /dev/null +++ b/bevy_proto_derive/src/asset_schematic/container_attributes.rs @@ -0,0 +1,40 @@ +use syn::{Attribute, Error}; + +use crate::common::input::{parse_input_meta, InputType, OutputType, SchematicIo}; +use crate::utils::constants::{ASSET_SCHEMATIC_ATTR, FROM_ATTR, INPUT_ATTR, INTO_ATTR}; +use crate::utils::{ + define_attribute, parse_bool, parse_nested_meta, AttrArg, AttrArgValue, AttrTarget, +}; + +define_attribute!("no_preload" => NoPreloadArg(bool) for AttrTarget::Asset); + +/// Attribute information on the container type. +#[derive(Default)] +pub(super) struct ContainerAttributes { + no_preload: NoPreloadArg, +} + +impl ContainerAttributes { + pub fn new(attrs: &[Attribute], io: &mut SchematicIo) -> Result { + let mut this = Self::default(); + + for attr in attrs { + if !attr.path().is_ident(ASSET_SCHEMATIC_ATTR) { + continue; + } + + parse_nested_meta!(attr, |meta| { + FROM_ATTR => io.try_set_input_ty(InputType::Existing(meta.value()?.parse()?), None), + INTO_ATTR => io.try_set_output_ty(OutputType::Custom(meta.value()?.parse()?), None), + INPUT_ATTR => parse_input_meta(meta, io), + NoPreloadArg::NAME => this.no_preload.try_set(Some(parse_bool(&meta)?), meta.input.span()), + })?; + } + + Ok(this) + } + + pub fn no_preload(&self) -> bool { + self.no_preload.get().copied().unwrap_or_default() + } +} diff --git a/bevy_proto_derive/src/asset_schematic/derive.rs b/bevy_proto_derive/src/asset_schematic/derive.rs new file mode 100644 index 0000000..1d09c6e --- /dev/null +++ b/bevy_proto_derive/src/asset_schematic/derive.rs @@ -0,0 +1,164 @@ +use crate::asset_schematic::container_attributes::ContainerAttributes; +use crate::common::data::{DeriveType, SchematicData}; +use crate::common::input::{ + generate_from_reflect_conversion, generate_input, generate_input_conversion, + generate_preload_input_conversion, InputType, OutputType, SchematicIo, +}; +use crate::utils::constants::{CONTEXT_IDENT, DEPENDENCIES_IDENT, ID_IDENT, INPUT_IDENT}; +use crate::utils::exports::{ + AssetSchematic, DependenciesBuilder, PreloadAssetSchematic, SchematicContext, SchematicId, +}; +use proc_macro2::{Ident, TokenStream}; +use quote::{quote, ToTokens}; +use syn::parse::{Parse, ParseStream}; +use syn::{DeriveInput, Error, Generics, Visibility}; + +pub(crate) struct DeriveAssetSchematic { + attrs: ContainerAttributes, + generics: Generics, + data: SchematicData, + io: SchematicIo, +} + +impl DeriveAssetSchematic { + fn attrs(&self) -> &ContainerAttributes { + &self.attrs + } + + fn generics(&self) -> &Generics { + &self.generics + } + + fn io(&self) -> &SchematicIo { + &self.io + } + + fn output_ty(&self) -> &OutputType { + self.io.output_ty() + } + + fn input_ty(&self) -> &InputType { + self.io.input_ty() + } + + fn data(&self) -> &SchematicData { + &self.data + } + + fn load_def(&self) -> TokenStream { + let from_reflect = generate_from_reflect_conversion(); + let conversion = generate_input_conversion(self.io()); + + quote! { + #from_reflect + + #conversion + + #INPUT_IDENT + } + } + + /// Generates the logic for `PreloadAssetSchematic::preload`. + fn preload_def(&self) -> Option { + if self.attrs.no_preload() { + return None; + } + + let from_reflect = generate_from_reflect_conversion(); + let conversion = generate_preload_input_conversion(self.io()); + + Some(quote! { + let #INPUT_IDENT = &#INPUT_IDENT; + + #from_reflect + + #conversion + + #INPUT_IDENT + }) + } + + fn try_to_tokens(&self) -> Result { + let ident: &Ident = self.io.ident(); + let (impl_generics, ty_generics, where_clause) = self.generics().split_for_impl(); + + let input = generate_input( + self.io(), + self.data(), + self.generics(), + self.attrs().no_preload(), + )?; + let load_def = self.load_def(); + + let input_vis = self.io.input_vis(); + let input_ty = match self.input_ty() { + InputType::Generated(ident) => { + quote!(#ident #ty_generics) + } + input_ty => input_ty.to_token_stream(), + }; + let output_ty = self.output_ty(); + + let preload_impl = self.preload_def().map( |preload_def| { + quote! { + impl #impl_generics #PreloadAssetSchematic for #ident #ty_generics #where_clause { + fn preload(#INPUT_IDENT: Self::Input, #ID_IDENT: #SchematicId, #DEPENDENCIES_IDENT: &mut #DependenciesBuilder) -> Self::Output { + #preload_def + } + } + } + }); + + let output = quote! { + #input + + impl #impl_generics #AssetSchematic for #ident #ty_generics #where_clause { + type Input = #input_ty; + type Output = #output_ty; + + fn load(#INPUT_IDENT: &Self::Input, #ID_IDENT: #SchematicId, #CONTEXT_IDENT: &mut #SchematicContext) -> Self::Output { + #load_def + } + } + + #preload_impl + }; + + Ok(match input_vis { + None | Some(Visibility::Inherited) => quote! { + const _: () = { + #output + }; + }, + _ => output, + }) + } +} + +impl Parse for DeriveAssetSchematic { + fn parse(input: ParseStream) -> syn::Result { + let input = input.parse::()?; + + let mut io = SchematicIo::new(&input); + + let attrs = ContainerAttributes::new(&input.attrs, &mut io)?; + + let data = SchematicData::new(input.data, &mut io, DeriveType::AssetSchematic)?; + + Ok(Self { + attrs, + generics: input.generics, + data, + io, + }) + } +} + +impl ToTokens for DeriveAssetSchematic { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self.try_to_tokens() { + Ok(output) => tokens.extend(output), + Err(err) => tokens.extend(err.to_compile_error()), + } + } +} diff --git a/bevy_proto_derive/src/asset_schematic/external.rs b/bevy_proto_derive/src/asset_schematic/external.rs new file mode 100644 index 0000000..d6cd57f --- /dev/null +++ b/bevy_proto_derive/src/asset_schematic/external.rs @@ -0,0 +1,44 @@ +use crate::asset_schematic::DeriveAssetSchematic; +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use syn::parse::{Parse, ParseStream}; + +/// Definition struct for the [`impl_external_asset_schematic`] macro. +/// +/// # Example +/// +/// ```ignore +/// impl_external_asset_schematic!{ +/// struct ExternalType { +/// #[schematic(asset)] +/// image: Handle +/// } +/// } +/// ``` +/// +/// [`impl_external_asset_schematic`]: crate::impl_external_asset_schematic +pub(crate) struct ExternalAssetSchematic { + schematic_data: DeriveAssetSchematic, + other_content: TokenStream, +} + +impl Parse for ExternalAssetSchematic { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + schematic_data: input.parse::()?, + other_content: input.parse::()?, + }) + } +} + +impl ToTokens for ExternalAssetSchematic { + fn to_tokens(&self, tokens: &mut TokenStream) { + let impls = &self.schematic_data; + let other = &self.other_content; + tokens.extend(quote! { + #impls + + #other + }); + } +} diff --git a/bevy_proto_derive/src/asset_schematic/mod.rs b/bevy_proto_derive/src/asset_schematic/mod.rs new file mode 100644 index 0000000..4a5d72a --- /dev/null +++ b/bevy_proto_derive/src/asset_schematic/mod.rs @@ -0,0 +1,6 @@ +pub(crate) use derive::DeriveAssetSchematic; +pub(crate) use external::ExternalAssetSchematic; + +mod container_attributes; +mod derive; +mod external; diff --git a/bevy_proto_derive/src/common/data/derive_type.rs b/bevy_proto_derive/src/common/data/derive_type.rs new file mode 100644 index 0000000..1bdcba7 --- /dev/null +++ b/bevy_proto_derive/src/common/data/derive_type.rs @@ -0,0 +1,19 @@ +use crate::utils::constants::{ASSET_SCHEMATIC_ATTR, SCHEMATIC_ATTR}; + +/// Indicates which derive macro is being used. +#[derive(Copy, Clone)] +pub(crate) enum DeriveType { + /// The `Schematic` derive macro. + Schematic, + /// The `AssetSchematic` derive macro. + AssetSchematic, +} + +impl DeriveType { + pub fn attr_name(&self) -> &'static str { + match self { + Self::Schematic => SCHEMATIC_ATTR, + Self::AssetSchematic => ASSET_SCHEMATIC_ATTR, + } + } +} diff --git a/bevy_proto_derive/src/common/data/mod.rs b/bevy_proto_derive/src/common/data/mod.rs new file mode 100644 index 0000000..9e84fbd --- /dev/null +++ b/bevy_proto_derive/src/common/data/mod.rs @@ -0,0 +1,7 @@ +pub(crate) use derive_type::*; +pub(crate) use schematic_data::*; +pub(crate) use variants::*; + +mod derive_type; +mod schematic_data; +mod variants; diff --git a/bevy_proto_derive/src/common/data/schematic_data.rs b/bevy_proto_derive/src/common/data/schematic_data.rs new file mode 100644 index 0000000..b03468d --- /dev/null +++ b/bevy_proto_derive/src/common/data/schematic_data.rs @@ -0,0 +1,35 @@ +use crate::common::data::{DeriveType, SchematicVariant}; +use crate::common::fields::SchematicFields; +use crate::common::input::SchematicIo; +use syn::{Data, Error}; + +/// The shape and data of a schematic. +pub(crate) enum SchematicData { + Struct(SchematicFields), + Enum(Vec), +} + +impl SchematicData { + pub fn new(data: Data, io: &mut SchematicIo, derive_type: DeriveType) -> Result { + match data { + Data::Struct(data) => Ok(Self::Struct(SchematicFields::new( + &data.fields, + io, + derive_type, + )?)), + Data::Enum(data) => Ok(Self::Enum( + data.variants + .into_iter() + .map(|variant| { + let fields = SchematicFields::new(&variant.fields, io, derive_type)?; + Ok(SchematicVariant { + ident: variant.ident, + fields, + }) + }) + .collect::>()?, + )), + Data::Union(data) => Err(Error::new(data.union_token.span, "unions not supported")), + } + } +} diff --git a/bevy_proto_derive/src/common/data/variants.rs b/bevy_proto_derive/src/common/data/variants.rs new file mode 100644 index 0000000..c2eec1c --- /dev/null +++ b/bevy_proto_derive/src/common/data/variants.rs @@ -0,0 +1,153 @@ +use crate::common::fields::{FieldKind, SchematicField, SchematicFields}; +use crate::common::input::SchematicIo; +use proc_macro2::{Ident, TokenStream}; +use quote::{format_ident, quote}; +use syn::{Error, Member}; + +pub(crate) struct SchematicVariant { + pub ident: Ident, + pub fields: SchematicFields, +} + +impl SchematicVariant { + pub fn generate_conversion_arm(&self, io: &SchematicIo) -> Result { + let input_ty = io.input_ty(); + let output_ty = io.output_ty(); + let variant = &self.ident; + + Ok(match &self.fields { + SchematicFields::Unit => quote! { + #input_ty::#variant => #output_ty::#variant + }, + SchematicFields::Named(fields) | SchematicFields::Unnamed(fields) => { + let mut patterns = Vec::new(); + let mut conversions = Vec::new(); + for field in fields.iter() { + match field.member() { + Member::Named(ident) => { + patterns.push(quote!(#ident)); + + let conversion = field.generate_conversion(Some(quote!(#ident)))?; + conversions.push(quote!(#ident: #conversion)) + } + Member::Unnamed(index) => { + let ident = format_ident!("field_{}", index); + patterns.push(quote!(#index: #ident)); + + let conversion = field.generate_conversion(Some(quote!(#ident)))?; + conversions.push(quote!(#index: #conversion)) + } + } + } + + quote! { + #input_ty::#variant{ #(#patterns,)* .. } => Self::#variant{ #(#conversions),* } + } + } + }) + } + + pub fn generate_preload_conversion_arm(&self, io: &SchematicIo) -> Result { + let input_ty = io.input_ty(); + let output_ty = io.output_ty(); + let variant = &self.ident; + + Ok(match &self.fields { + SchematicFields::Unit => quote! { + #input_ty::#variant => #output_ty::#variant + }, + SchematicFields::Named(fields) | SchematicFields::Unnamed(fields) => { + let mut patterns = Vec::new(); + let mut conversions = Vec::new(); + for field in fields.iter() { + match field.member() { + Member::Named(ident) => { + patterns.push(quote!(#ident)); + + let conversion = + field.generate_preload_conversion(Some(quote!(#ident)))?; + conversions.push(quote!(#ident: #conversion)) + } + Member::Unnamed(index) => { + let ident = format_ident!("field_{}", index); + patterns.push(quote!(#index: #ident)); + + let conversion = + field.generate_preload_conversion(Some(quote!(#ident)))?; + conversions.push(quote!(#index: #conversion)) + } + } + } + + quote! { + #input_ty::#variant{ #(#patterns,)* .. } => Self::#variant{ #(#conversions),* } + } + } + }) + } + + pub fn generate_preload_arm(&self, io: &SchematicIo) -> Result { + let input_ty = io.input_ty(); + let variant = &self.ident; + + Ok(match &self.fields { + SchematicFields::Unit => quote! { + #input_ty::#variant => {/* Do nothing */}, + }, + SchematicFields::Named(fields) | SchematicFields::Unnamed(fields) => { + let mut patterns = Vec::new(); + let mut preloads = Vec::new(); + let preload_fields = fields.iter().filter(|field| match field.config().kind() { + Some(FieldKind::Asset(config)) => config.preload(), + _ => false, + }); + for field in preload_fields { + match field.member() { + Member::Named(ident) => { + patterns.push(quote!(#ident)); + preloads.push(field.generate_preload(Some(quote!(*#ident)))?) + } + Member::Unnamed(index) => { + let ident = format_ident!("field_{}", index); + patterns.push(quote!(#index: #ident)); + preloads.push(field.generate_preload(Some(quote!(*#ident)))?) + } + } + } + + quote! { + #input_ty::#variant{ #(#patterns,)* .. } => { + #(#preloads)* + } + } + } + }) + } + + pub fn generate_definition(&self) -> TokenStream { + let variant = &self.ident; + match &self.fields { + SchematicFields::Unit => quote! { + #variant + }, + SchematicFields::Named(fields) => { + let fields = fields + .iter() + .filter(SchematicField::requires_input_field) + .map(SchematicField::generate_definition); + quote! { + #variant { #(#fields),* } + } + } + SchematicFields::Unnamed(fields) => { + let fields = fields + .iter() + .filter(SchematicField::requires_input_field) + .map(SchematicField::generate_definition); + quote! { + #variant ( #(#fields),* ) + } + } + } + } +} diff --git a/bevy_proto_derive/src/common/fields/asset_config.rs b/bevy_proto_derive/src/common/fields/asset_config.rs new file mode 100644 index 0000000..2ee5619 --- /dev/null +++ b/bevy_proto_derive/src/common/fields/asset_config.rs @@ -0,0 +1,203 @@ +use std::fmt::{Debug, Formatter}; + +use proc_macro2::{Span, TokenStream}; +use quote::ToTokens; +use syn::spanned::Spanned; +use syn::{Error, GenericArgument, LitStr, PathArguments, Type}; + +use crate::utils::constants::ASSET_ATTR; +use crate::utils::{debug_attribute, NextId, RandomId}; +use crate::utils::{define_attribute, AttrArg, AttrArgValue, AttrTarget}; + +define_attribute!("preload" => AssetPreloadArg(bool) for AttrTarget::Asset); +define_attribute!("inline" => AssetInlineArg(bool) for AttrTarget::Asset); +define_attribute!("untyped" => AssetUntypedArg(bool) for AttrTarget::Asset); +define_attribute!("unique" => AssetUniqueArg(bool) for AttrTarget::Asset); +define_attribute!("type" => AssetTypeArg(Type) for AttrTarget::Asset); +define_attribute!("path" => AssetPathArg(LitStr) for AttrTarget::Asset); + +/// Specifies the configuration for asset-containing fields. +#[derive(Default)] +pub(crate) struct AssetConfig { + /// Used to specify whether the asset should be preloaded. + /// + /// Form: `#[asset_schematic(asset(preload))]`. + preload: AssetPreloadArg, + /// Used to specify whether the asset should result in a new asset handle being created. + /// + /// Form: `#[asset_schematic(asset(unique))]`. + unique: AssetUniqueArg, + /// Used to specify whether the asset should be allowed to be defined inlined. + /// + /// Form: `#[asset_schematic(asset(inline))]`. + inline: AssetInlineArg, + /// Used to specify a static path to an asset. + /// + /// Form: `#[asset_schematic(asset(path = "path/to/asset.png"))]`. + path: AssetPathArg, + /// Used to set the type of the asset. + /// + /// Form: `#[asset_schematic(asset(type = path::to::Foo))]`. + custom_type: AssetTypeArg, + /// Used to specify whether the asset should be defined as a `HandleUntyped`. + /// + /// Form: `#[asset_schematic(asset(untyped))]`. + untyped: AssetUntypedArg, +} + +impl AssetConfig { + pub fn preload(&self) -> bool { + self.preload.get().copied().unwrap_or_default() + } + + pub fn try_set_preload(&mut self, value: bool, span: Span) -> Result<(), Error> { + if self.unique() { + return Err(self.preload.invariant_error::(span)); + } + + self.preload.try_set(Some(value), span) + } + + pub fn unique(&self) -> bool { + self.unique.get().copied().unwrap_or_default() + } + + pub fn try_set_unique(&mut self, value: bool, span: Span) -> Result<(), Error> { + if self.preload() { + return Err(self.unique.invariant_error::(span)); + } + + self.unique.try_set(Some(value), span) + } + + pub fn inline(&self) -> bool { + self.inline.get().copied().unwrap_or_default() + } + + pub fn try_set_inline(&mut self, value: bool, span: Span) -> Result<(), Error> { + if self.path().is_some() { + return Err(self.inline.invariant_error::(span)); + } + + self.inline.try_set(Some(value), span) + } + + pub fn path(&self) -> Option<&LitStr> { + self.path.get() + } + + pub fn try_set_path(&mut self, value: LitStr, span: Span) -> Result<(), Error> { + if self.inline() { + return Err(self.inline.invariant_error::(span)); + } + + self.path.try_set(Some(value), span) + } + + pub fn custom_type(&self) -> Option<&Type> { + self.custom_type.get() + } + + pub fn try_set_custom_type(&mut self, value: Type, span: Span) -> Result<(), Error> { + if self.untyped() { + return Err(self.custom_type.invariant_error::(span)); + } + + self.custom_type.try_set(Some(value), span) + } + + pub fn untyped(&self) -> bool { + self.untyped.get().copied().unwrap_or_default() + } + + // TODO: Handle untyped assets + // pub fn try_set_untyped(&mut self, value: bool, span: Span) -> Result<(), Error> { + // if self.custom_type().is_some() { + // return Err(self.untyped.invariant_error::(span)); + // } + // + // self.untyped.try_set(Some(value), span) + // } + + /// Create a token generator that creates schematic IDs. + /// + /// This will choose between a random or stable ID based on the asset's `unique` attribute. + pub fn asset_id(&self) -> AssetIdGenerator { + AssetIdGenerator { + random: self.unique(), + } + } + + pub fn try_extract_asset_type<'a>(&'a self, defined_ty: &'a Type) -> Result<&'a Type, Error> { + if let Some(ty) = self.custom_type() { + Ok(ty) + } else { + AssetConfig::extract_asset_type(defined_ty) + } + } + + /// Attempts to extract the asset type from either a `Handle` or an `Option`. + fn extract_asset_type(ty: &Type) -> Result<&Type, Error> { + let create_error = || { + Error::new(ty.span(), format_args!( + "could not automatically extract asset type: please specify it manually using `{}({} = path::to::YourAssetType)`", + ASSET_ATTR, + AssetTypeArg::NAME + )) + }; + + match ty { + Type::Path(type_path) if type_path.qself.is_none() => { + if let Some(segment) = type_path.path.segments.last() { + let PathArguments::AngleBracketed(args) = &segment.arguments else { + return Err(create_error()); + }; + let Some(GenericArgument::Type(ty)) = args.args.first() else { + return Err(create_error()); + }; + + if segment.ident == "Handle" { + return Ok(ty); + } else if segment.ident == "Option" { + return Self::extract_asset_type(ty); + } + } + } + _ => {} + } + + Err(create_error()) + } +} + +impl Debug for AssetConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "(")?; + + debug_attribute(f, |write| { + write(format_args!("{:?}", self.preload))?; + write(format_args!("{:?}", self.inline))?; + write(format_args!("{:?}", self.untyped))?; + write(format_args!("{:?}", self.custom_type))?; + write(format_args!("{:?}", self.path))?; + + Ok(()) + })?; + + write!(f, ")") + } +} + +pub(crate) struct AssetIdGenerator { + random: bool, +} + +impl ToTokens for AssetIdGenerator { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.random { + RandomId.to_tokens(tokens); + } else { + NextId.to_tokens(tokens); + } + } +} diff --git a/bevy_proto_derive/src/common/fields/config.rs b/bevy_proto_derive/src/common/fields/config.rs new file mode 100644 index 0000000..68e6161 --- /dev/null +++ b/bevy_proto_derive/src/common/fields/config.rs @@ -0,0 +1,160 @@ +use crate::common::data::DeriveType; +use crate::common::fields::{AssetConfig, EntityConfig}; +use crate::utils::constants::{ASSET_ATTR, ENTITY_ATTR, FROM_ATTR}; +use crate::utils::debug_attribute; +use crate::utils::{define_attribute, AttrArgValue, AttrTarget}; +use proc_macro2::Span; +use quote::ToTokens; +use std::fmt::{Debug, Formatter}; +use syn::{Error, Type}; + +define_attribute!("optional" => OptionalArg(bool) for AttrTarget::Field); + +/// The base configuration for the field of a `Schematic` or `AssetSchematic`. +pub(crate) struct FieldConfig { + /// The type of the derive. + /// + /// This isn't configured by the user, but is instead inferred from the derive type. + /// + /// The only reason this is stored is so that we can use it in error messages. + derive_type: DeriveType, + /// The kind of the field. + /// + /// This controls what the field does and all of its configuration. + kind: Option, + /// Whether the field should be generated as wrapped in an `Option`. + /// + /// The [`ProtoFieldBuilder`] will automatically try to infer this from the field's type, + /// but this attribute allows the user to configure it manually if needed. + /// + /// # Example + /// + /// ```ignore + /// #[derive(Schematic)] + /// struct Foo { + /// #[schematic(optional, entity)] + /// bar: Option, + /// } + /// ``` + /// + /// [`ProtoFieldBuilder`]: crate::common::fields::ProtoFieldBuilder + optional: OptionalArg, +} + +impl FieldConfig { + pub fn try_init_from_kind(&mut self, ty: Type, span: Span) -> Result<(), Error> { + match &self.kind { + None => { + self.kind = Some(FieldKind::From(ty)); + } + Some(current) => { + return Err(Error::new( + span, + format!("field already configured as `{:?}`", current), + )); + } + } + + Ok(()) + } + + pub fn try_init_entity_kind(&mut self, span: Span) -> Result<&mut EntityConfig, Error> { + match &self.kind { + None => { + self.kind = Some(FieldKind::Entity(EntityConfig::default())); + } + Some(FieldKind::Entity(_)) => {} + Some(current) => { + return Err(Error::new( + span, + format!("field already configured as `{:?}`", current), + )); + } + } + + let FieldKind::Entity(config) = self.kind.as_mut().unwrap() else { + unreachable!() + }; + Ok(config) + } + + pub fn try_init_asset_kind(&mut self, span: Span) -> Result<&mut AssetConfig, Error> { + match &self.kind { + None => { + self.kind = Some(FieldKind::Asset(AssetConfig::default())); + } + Some(FieldKind::Asset(_)) => {} + Some(current) => { + return Err(Error::new( + span, + format!("field already configured as `{:?}`", current), + )); + } + } + + let FieldKind::Asset(config) = self.kind.as_mut().unwrap() else { + unreachable!() + }; + Ok(config) + } + + pub fn kind(&self) -> Option<&FieldKind> { + self.kind.as_ref() + } + + pub fn optional(&self) -> bool { + self.optional.get().copied().unwrap_or_default() + } + + pub fn try_set_optional(&mut self, value: bool, span: Span) -> Result<(), Error> { + match self.kind() { + None | Some(FieldKind::From(_)) => Err(Error::new( + span, + "cannot set `optional` on a field that is not marked as an `entity` or `asset`", + )), + _ => self.optional.try_set(Some(value), span), + } + } +} + +impl Default for FieldConfig { + fn default() -> Self { + Self { + derive_type: DeriveType::Schematic, + kind: None, + optional: OptionalArg::default(), + } + } +} + +impl Debug for FieldConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let attr = self.derive_type.attr_name(); + write!(f, "#[{attr}(")?; + + debug_attribute(f, |write| { + write(format_args!("{:?}", self.optional))?; + write(format_args!("{:?}", self.kind))?; + + Ok(()) + })?; + + write!(f, ")]") + } +} + +pub(crate) enum FieldKind { + From(Type), + Entity(EntityConfig), + Asset(AssetConfig), +} + +impl Debug for FieldKind { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + Self::From(ty) => write!(f, "{FROM_ATTR} = {}", ty.to_token_stream()), + Self::Entity(config) => write!(f, "{ENTITY_ATTR}{:?}", config), + Self::Asset(config) => write!(f, "{ASSET_ATTR}{:?}", config), + } + } +} diff --git a/bevy_proto_derive/src/common/fields/entity_config.rs b/bevy_proto_derive/src/common/fields/entity_config.rs new file mode 100644 index 0000000..1fad942 --- /dev/null +++ b/bevy_proto_derive/src/common/fields/entity_config.rs @@ -0,0 +1,37 @@ +use crate::utils::debug_attribute; +use crate::utils::{define_attribute, AttrArgValue, AttrTarget}; +use proc_macro2::Span; +use std::fmt::{Debug, Formatter}; +use syn::{Error, LitStr}; + +define_attribute!("path" => EntityPathArg(LitStr) for AttrTarget::Field); + +#[derive(Default)] +pub(crate) struct EntityConfig { + /// Represents a static path to an entity in the prototype tree. + path: EntityPathArg, +} + +impl EntityConfig { + pub fn path(&self) -> Option<&LitStr> { + self.path.get() + } + + pub fn try_set_path(&mut self, value: LitStr, span: Span) -> Result<(), Error> { + self.path.try_set(Some(value), span) + } +} + +impl Debug for EntityConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "(")?; + + debug_attribute(f, |write| { + write(format_args!("{:?}", self.path))?; + + Ok(()) + })?; + + write!(f, ")") + } +} diff --git a/bevy_proto_derive/src/common/fields/mod.rs b/bevy_proto_derive/src/common/fields/mod.rs new file mode 100644 index 0000000..2e0b807 --- /dev/null +++ b/bevy_proto_derive/src/common/fields/mod.rs @@ -0,0 +1,11 @@ +pub(crate) use asset_config::*; +pub(crate) use config::*; +pub(crate) use entity_config::*; +pub(crate) use schematic_field::*; +pub(crate) use schematic_fields::*; + +mod asset_config; +mod config; +mod entity_config; +mod schematic_field; +mod schematic_fields; diff --git a/bevy_proto_derive/src/common/fields/schematic_field.rs b/bevy_proto_derive/src/common/fields/schematic_field.rs new file mode 100644 index 0000000..e5ad5fc --- /dev/null +++ b/bevy_proto_derive/src/common/fields/schematic_field.rs @@ -0,0 +1,379 @@ +use crate::common::fields::{FieldConfig, FieldKind}; +use crate::utils::constants::{CONTEXT_IDENT, DEPENDENCIES_IDENT, INPUT_IDENT, TEMP_IDENT}; +use crate::utils::exports::{ + AssetServer, EntityAccess, FromReflect, FromSchematicInput, FromSchematicPreloadInput, + InlinableProtoAsset, ProtoAsset, Reflect, +}; +use crate::utils::NextId; +use proc_macro2::{Span, TokenStream}; +use quote::{quote, quote_spanned, ToTokens}; +use syn::spanned::Spanned; +use syn::{parse_quote, Attribute, Error, Field, Member, Type}; + +/// The base field information for fields of a `Schematic` or `AssetSchematic`. +pub(crate) struct SchematicField { + /// The Bevy `#[reflect]` attributes applied to the field. + /// + /// These are used when generating the input type. + reflect_attrs: Vec, + /// The field's configuration. + config: FieldConfig, + /// The member (ident or index) used to access this field. + member: Member, + /// The type of the field, as defined by the user. + /// + /// This might not be what is actually generated in the input type. + defined_ty: Type, +} + +impl SchematicField { + pub fn new(field: &Field, field_index: usize) -> Self { + Self { + defined_ty: field.ty.clone(), + member: field + .ident + .clone() + .map(Member::Named) + .unwrap_or(Member::Unnamed(field_index.into())), + reflect_attrs: Vec::new(), + config: FieldConfig::default(), + } + } + + /// Pushes a `#[reflect]` attribute to the field. + pub fn push_reflect_attr(&mut self, attr: Attribute) { + self.reflect_attrs.push(attr); + } + + /// Returns a reference to the field's configuration. + pub fn config(&self) -> &FieldConfig { + &self.config + } + + /// Returns a mutable reference to the field's configuration. + pub fn config_mut(&mut self) -> &mut FieldConfig { + &mut self.config + } + + /// The member (ident or index) used to access this field. + pub fn member(&self) -> &Member { + &self.member + } + + /// Determines whether or not a generated input type should contain this field. + /// + /// For fields that cannot be configured by a prototype file (e.g. `path` attributes), + /// this should return `false`. + pub fn requires_input_field(self: &&Self) -> bool { + match self.config.kind() { + Some(FieldKind::Entity(config)) => config.path().is_none(), + Some(FieldKind::Asset(config)) => config.path().is_none(), + _ => true, + } + } + + /// The type of the field within a generated input type. + /// + /// This may or may not be the same as the field's user-defined type. + pub fn input_ty(&self) -> Result { + let wrap_option = |ty: Type| -> Type { + if self.config.optional() { + parse_quote!(::core::option::Option<#ty>) + } else { + ty + } + }; + + Ok(match self.config.kind() { + None => self.defined_ty.clone(), + Some(FieldKind::From(ty)) => wrap_option(ty.clone()), + Some(FieldKind::Entity(_)) => wrap_option(parse_quote!(#EntityAccess)), + Some(FieldKind::Asset(config)) => { + let ty = if config.untyped() { + None + } else { + Some(config.try_extract_asset_type(&self.defined_ty)?) + }; + + let inline = config.inline(); + + match (inline, ty) { + (true, Some(ty)) => wrap_option(parse_quote!(#InlinableProtoAsset<#ty>)), + (false, Some(ty)) => wrap_option(parse_quote!(#ProtoAsset<#ty>)), + _ => { + return Err(Error::new( + self.member.span(), + "untyped assets are not yet supported", + )) + } + } + } + }) + } + + /// Generate this field's definition within a generated input type. + pub fn generate_definition(&self) -> TokenStream { + let reflect_attrs = &self.reflect_attrs; + let ty = match self.input_ty() { + Ok(ty) => ty, + Err(err) => return err.to_compile_error(), + }; + match &self.member { + Member::Named(ident) => quote! { + #(#reflect_attrs)* + #ident: #ty + }, + Member::Unnamed(_) => quote! { + #(#reflect_attrs)* + #ty + }, + } + } + + /// Generate this field's conversion from the generated input type to the user-defined type. + /// + /// The generated `TokenStream` will be an expression that accesses the field from the input + /// type and converts it to the user-defined type. + pub fn generate_conversion( + &self, + custom_accessor: Option, + ) -> Result { + // Locate span at the field's member so that error messages point to the offending field. + let span = Span::call_site().located_at(self.member.span()); + + let accessor = custom_accessor.unwrap_or_else(|| { + let member = self.member(); + quote_spanned!(span => #INPUT_IDENT.#member) + }); + + Ok(match self.config.kind() { + Some(FieldKind::From(_)) => { + if self.config.optional() { + quote_spanned! {span => + #accessor.map(|#TEMP_IDENT| #FromSchematicInput::from_input( + #TEMP_IDENT, + #NextId, + #CONTEXT_IDENT, + )) + } + } else { + quote_spanned! {span => + #FromSchematicInput::from_input( + #accessor, + #NextId, + #CONTEXT_IDENT, + ) + } + } + } + Some(FieldKind::Entity(config)) => { + let access = if let Some(path) = config.path() { + quote_spanned!(span => #EntityAccess::from(#path)) + } else { + quote_spanned!(span => #accessor) + }; + + if self.config.optional() { + quote_spanned! {span => + #access.map(|#TEMP_IDENT| #FromSchematicInput::from_input( + #TEMP_IDENT, + #NextId, + #CONTEXT_IDENT, + )) + } + } else { + quote_spanned! {span => + #FromSchematicInput::from_input( + #access, + #NextId, + #CONTEXT_IDENT, + ) + } + } + } + Some(FieldKind::Asset(config)) => { + let id = config.asset_id(); + + if let Some(path) = config.path() { + quote_spanned! {span => + #CONTEXT_IDENT + .world() + .resource::<#AssetServer>() + .load(#path) + } + } else if self.config.optional() { + quote_spanned! {span => + #accessor.map(|#TEMP_IDENT| #FromSchematicInput::from_input( + #TEMP_IDENT, + #id, + #CONTEXT_IDENT, + )) + } + } else { + quote_spanned! {span => + #FromSchematicInput::from_input( + #accessor, + #id, + #CONTEXT_IDENT, + ) + } + } + } + _ => quote_spanned!(span => #accessor), + }) + } + + /// Generate the preload-specific conversion from the generated input type to the user-defined type. + /// + /// The generated `TokenStream` will be an expression that accesses the field from the input + /// type and converts it to the user-defined type. + pub fn generate_preload_conversion( + &self, + custom_accessor: Option, + ) -> Result { + // Locate span at the field's member so that error messages point to the offending field. + let span = Span::call_site().located_at(self.member.span()); + + let accessor = custom_accessor.unwrap_or_else(|| { + let member = self.member(); + quote_spanned!(span => #INPUT_IDENT.#member) + }); + + Ok(match self.config.kind() { + Some(FieldKind::From(_)) => { + if self.config.optional() { + quote_spanned! {span => + #accessor.map(|#TEMP_IDENT| #FromSchematicPreloadInput::from_preload_input( + #TEMP_IDENT, + #NextId, + #DEPENDENCIES_IDENT, + )) + } + } else { + quote_spanned! {span => + #FromSchematicPreloadInput::from_preload_input( + #accessor, + #NextId, + #DEPENDENCIES_IDENT, + ) + } + } + } + Some(FieldKind::Entity(_)) => TokenStream::new(), + Some(FieldKind::Asset(config)) => { + let id = config.asset_id(); + + if let Some(path) = config.path() { + if self.config.optional() { + quote_spanned! {span => + ::core::option::Option::Some(#DEPENDENCIES_IDENT.add_dependency(#path)) + } + } else { + quote_spanned! {span => + #DEPENDENCIES_IDENT.add_dependency(#path) + } + } + } else if self.config.optional() { + quote_spanned! {span => + #accessor.map(|#TEMP_IDENT| #FromSchematicPreloadInput::from_preload_input( + #TEMP_IDENT, + #id, + #DEPENDENCIES_IDENT, + )) + } + } else { + quote_spanned! {span => + #FromSchematicPreloadInput::from_preload_input( + #accessor, + #id, + #DEPENDENCIES_IDENT, + ) + } + } + } + _ => quote_spanned!(span => #accessor), + }) + } + + /// Generates the preload code for the field (assets-only). + /// + /// The generated `TokenStream` will be a statement that sets the user-defined field to the asset + /// loaded using the input type's field. + pub fn generate_preload( + &self, + variant_field_ident: Option, + ) -> Result { + // Locate span at the field's member so that error messages point to the offending field. + let span = Span::call_site().located_at(self.member.span()); + + Ok(match self.config.kind() { + Some(FieldKind::Asset(config)) if config.preload() => { + let accessor = variant_field_ident.unwrap_or_else(|| { + let member = self.member(); + quote_spanned!(span => #INPUT_IDENT.#member) + }); + + let asset_enum = if config.inline() { + InlinableProtoAsset.to_token_stream() + } else { + ProtoAsset.to_token_stream() + }; + + if let Some(path) = config.path() { + if self.config.optional() { + quote_spanned! {span => + #accessor = ::core::option::Option::Some( + #asset_enum::Handle(#DEPENDENCIES_IDENT.add_dependency(#path)) + ); + } + } else { + quote_spanned! {span => + #accessor = #asset_enum::Handle(#DEPENDENCIES_IDENT.add_dependency(#path)); + } + } + } else { + let input_ty = self.input_ty()?; + let asset_ty = config.try_extract_asset_type(&self.defined_ty)?; + let id = config.asset_id(); + + let convert = if self.config.optional() { + quote_spanned! {span => + #TEMP_IDENT.map(|#TEMP_IDENT| { + #asset_enum::Handle(#FromSchematicPreloadInput::from_preload_input( + #TEMP_IDENT, + #id, + #DEPENDENCIES_IDENT, + )) + }) + + } + } else { + quote_spanned! {span => + #asset_enum::Handle(#FromSchematicPreloadInput::from_preload_input( + #TEMP_IDENT, + #id, + #DEPENDENCIES_IDENT, + )) + } + }; + + quote_spanned! {span => + #accessor = { + let #TEMP_IDENT = <#input_ty as #FromReflect>::from_reflect( + &*#Reflect::clone_value(&#accessor) + ).unwrap_or_else(|| { + panic!( + "{} should have a functioning `FromReflect` impl", + ::std::any::type_name::<#asset_ty>() + ) + }); + + #convert + }; + } + } + } + _ => TokenStream::new(), + }) + } +} diff --git a/bevy_proto_derive/src/common/fields/schematic_fields.rs b/bevy_proto_derive/src/common/fields/schematic_fields.rs new file mode 100644 index 0000000..0168b2f --- /dev/null +++ b/bevy_proto_derive/src/common/fields/schematic_fields.rs @@ -0,0 +1,216 @@ +use crate::common::data::DeriveType; +use crate::common::fields::{ + AssetInlineArg, AssetPathArg, AssetPreloadArg, AssetTypeArg, AssetUniqueArg, EntityPathArg, + OptionalArg, SchematicField, +}; +use crate::common::input::{InputType, SchematicIo}; +use crate::utils::constants::{ASSET_ATTR, ENTITY_ATTR, FROM_ATTR}; +use crate::utils::{parse_bool, parse_nested_meta, AttrArg}; +use proc_macro2::Span; +use syn::meta::ParseNestedMeta; +use syn::spanned::Spanned; +use syn::{Error, Field, Fields, Type}; + +/// The collection of fields for a struct or enum. +pub(crate) enum SchematicFields { + Unit, + Named(Vec), + Unnamed(Vec), +} + +impl SchematicFields { + /// Creates a [`SchematicFields`] from a [`Fields`]. + /// + /// The `container_ident` is the name of the user-defined struct or enum that contains the fields + /// and will be used to generate the input type if necessary. + pub fn new( + fields: &Fields, + io: &mut SchematicIo, + derive_type: DeriveType, + ) -> Result { + Ok(match fields { + Fields::Unit => Self::Unit, + fields => { + let is_named = matches!(fields, Fields::Named(_)); + + let fields = fields + .iter() + .enumerate() + .map(|(field_index, field)| { + let proto_field = SchematicField::new(field, field_index); + + let builder = ProtoFieldBuilder { + field, + proto_field, + io, + derive_type, + }; + + builder.build() + }) + .collect::>()?; + + if is_named { + Self::Named(fields) + } else { + Self::Unnamed(fields) + } + } + }) + } +} + +/// Builds a [`SchematicField`] from a [`Field`]. +struct ProtoFieldBuilder<'a> { + field: &'a Field, + proto_field: SchematicField, + io: &'a mut SchematicIo, + derive_type: DeriveType, +} + +impl<'a> ProtoFieldBuilder<'a> { + fn build(mut self) -> Result { + for attr in &self.field.attrs { + if attr.path().is_ident("reflect") { + self.proto_field.push_reflect_attr(attr.clone()); + } + + if !attr.path().is_ident(self.derive_type.attr_name()) { + continue; + } + + match self.derive_type { + DeriveType::Schematic => { + parse_nested_meta!(attr, |meta| { + FROM_ATTR => self.parse_from_meta(meta), + ASSET_ATTR => self.parse_asset_meta(meta), + ENTITY_ATTR => self.parse_entity_meta(meta), + OptionalArg::NAME => self.parse_optional_meta(meta), + })?; + } + DeriveType::AssetSchematic => { + parse_nested_meta!(attr, |meta| { + FROM_ATTR => self.parse_from_meta(meta), + ASSET_ATTR => self.parse_asset_meta(meta), + OptionalArg::NAME => self.parse_optional_meta(meta), + })?; + } + } + } + + // Automatically detect `Option` types + if self.detect_optional() { + self.proto_field + .config_mut() + .try_set_optional(true, self.field.ty.span()) + .ok(); + } + + Ok(self.proto_field) + } + + /// Detects if the field is an `Option` type. + /// + /// Returns `true` if the field is an `Option` type or if it was manually marked as optional. + fn detect_optional(&mut self) -> bool { + if self.proto_field.config().optional() { + return true; + } + + match &self.field.ty { + Type::Path(ty_path) => ty_path + .path + .segments + .last() + .map(|segment| segment.ident == "Option" && !segment.arguments.is_empty()) + .unwrap_or_default(), + _ => false, + } + } + + /// Parse a `#[schematic(asset)]` attribute. + /// + /// This takes in the meta starting at `asset`. + fn parse_asset_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { + self.require_input(meta.path.span())?; + + let config = self + .proto_field + .config_mut() + .try_init_asset_kind(meta.path.span())?; + + if meta.input.is_empty() { + return Ok(()); + } + + match self.derive_type { + DeriveType::Schematic => { + parse_nested_meta!(meta, |meta| { + AssetPreloadArg::NAME => config.try_set_preload(parse_bool(&meta)?, meta.input.span()), + AssetInlineArg::NAME => config.try_set_inline(parse_bool(&meta)?, meta.input.span()), + AssetUniqueArg::NAME => config.try_set_unique(parse_bool(&meta)?, meta.input.span()), + AssetPathArg::NAME => config.try_set_path(meta.value()?.parse()?, meta.input.span()), + AssetTypeArg::NAME => config.try_set_custom_type(meta.value()?.parse()?, meta.input.span()), + }) + } + DeriveType::AssetSchematic => { + parse_nested_meta!(meta, |meta| { + AssetInlineArg::NAME => config.try_set_inline(parse_bool(&meta)?, meta.input.span()), + AssetPathArg::NAME => config.try_set_path(meta.value()?.parse()?, meta.input.span()), + AssetTypeArg::NAME => config.try_set_custom_type(meta.value()?.parse()?, meta.input.span()), + }) + } + } + } + + /// Parse a `#[schematic(entity)]` attribute. + /// + /// This takes in the meta starting at `entity`. + fn parse_entity_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { + self.require_input(meta.path.span())?; + + let config = self + .proto_field + .config_mut() + .try_init_entity_kind(meta.path.span())?; + + if meta.input.is_empty() { + return Ok(()); + } + + parse_nested_meta!(meta, |meta| { + EntityPathArg::NAME => config.try_set_path(meta.value()?.parse()?, meta.input.span()), + }) + } + + /// Parse a `#[schematic(from)]` attribute. + /// + /// This takes in the meta starting at `from`. + fn parse_from_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { + self.require_input(meta.path.span())?; + + self.proto_field + .config_mut() + .try_init_from_kind(meta.value()?.parse()?, meta.input.span()) + } + + /// Parse a `#[schematic(optional)]` attribute. + /// + /// This takes in the meta starting at `optional`. + fn parse_optional_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { + self.proto_field + .config_mut() + .try_set_optional(parse_bool(&meta)?, meta.input.span()) + } + + /// Method used to require that a `Schematic::Input` type be generated for the attribute + /// (identified by the given [`Span`]). + fn require_input(&mut self, span: Span) -> Result<(), Error> { + match &self.io.input_ty() { + InputType::Generated(_) => Ok(()), + _ => self + .io + .try_set_input_ty(InputType::new_generated(self.io.ident()), Some(span)), + } + } +} diff --git a/bevy_proto_derive/src/common/input/attr.rs b/bevy_proto_derive/src/common/input/attr.rs new file mode 100644 index 0000000..2c15e12 --- /dev/null +++ b/bevy_proto_derive/src/common/input/attr.rs @@ -0,0 +1,32 @@ +use crate::common::input::{InputType, SchematicIo}; +use crate::utils::parse_nested_meta; +use crate::utils::{define_attribute, AttrArg, AttrTarget}; +use proc_macro2::Ident; +use quote::ToTokens; +use std::fmt::{Debug, Formatter}; +use syn::meta::ParseNestedMeta; +use syn::{Error, Visibility}; + +define_attribute!("vis" => InputVisArg(Visibility) for AttrTarget::InputVisibility, no_debug); +define_attribute!("name" => InputNameArg(Ident) for AttrTarget::Input); + +impl Debug for InputVisArg { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match &self.0 { + None => Ok(()), + Some(Visibility::Inherited) => panic!("cannot explicitly set visibility to inherited"), + Some(Visibility::Public(_)) => write!(f, "{} = pub", Self::NAME), + Some(Visibility::Restricted(res)) => { + write!(f, "{} = {}", Self::NAME, res.to_token_stream()) + } + } + } +} + +/// Parses input attributes into the given [`SchematicIo`]. +pub(crate) fn parse_input_meta(meta: ParseNestedMeta, io: &mut SchematicIo) -> Result<(), Error> { + parse_nested_meta!(meta, |meta| { + InputVisArg::NAME => io.try_set_input_vis(meta.value()?.parse()?, None), + InputNameArg::NAME => io.try_set_input_ty(InputType::Generated(meta.value()?.parse()?), None), + }) +} diff --git a/bevy_proto_derive/src/common/input/converters.rs b/bevy_proto_derive/src/common/input/converters.rs new file mode 100644 index 0000000..2916c52 --- /dev/null +++ b/bevy_proto_derive/src/common/input/converters.rs @@ -0,0 +1,89 @@ +use crate::common::input::{InputType, OutputType, SchematicIo}; +use crate::utils::constants::{CONTEXT_IDENT, DEPENDENCIES_IDENT, INPUT_IDENT}; +use crate::utils::exports::{FromReflect, FromSchematicInput, FromSchematicPreloadInput, Reflect}; +use crate::utils::NextId; +use proc_macro2::TokenStream; +use quote::quote; + +/// Generates a statement that sets [`INPUT_IDENT`] to the output type using `FromSchematicInput`. +/// +/// Returns `None` if no conversion is necessary. +pub(crate) fn generate_input_conversion(io: &SchematicIo) -> Option { + let input_ty = io.input_ty(); + let output_ty = io.output_ty(); + + match (input_ty, output_ty) { + (InputType::Reflexive, OutputType::Reflexive) => { + // === No Conversion Necessary === // + None + } + (_, OutputType::Custom(output_ty)) => { + // === Input -> Self -> Output === // + Some(quote! { + let #INPUT_IDENT = >::from_input( + #INPUT_IDENT, #NextId, #CONTEXT_IDENT + ); + let #INPUT_IDENT = <#output_ty as #FromSchematicInput>::from_input( + #INPUT_IDENT, #NextId, #CONTEXT_IDENT + ); + }) + } + _ => { + // === Input -> Self === // + Some(quote! { + let #INPUT_IDENT = >::from_input( + #INPUT_IDENT, #NextId, #CONTEXT_IDENT + ); + }) + } + } +} + +/// Generates a statement that sets [`INPUT_IDENT`] to the output type using `FromSchematicPreloadInput`. +/// +/// Returns `None` if no conversion is necessary. +pub(crate) fn generate_preload_input_conversion(io: &SchematicIo) -> Option { + let input_ty = io.input_ty(); + let output_ty = io.output_ty(); + + match (input_ty, output_ty) { + (InputType::Reflexive, OutputType::Reflexive) => { + // === No Conversion Necessary === // + None + } + (_, OutputType::Custom(output_ty)) => { + // === Input -> Self -> Output === // + Some(quote! { + let #INPUT_IDENT = >::from_preload_input( + #INPUT_IDENT, #NextId, #DEPENDENCIES_IDENT + ); + let #INPUT_IDENT = <#output_ty as #FromSchematicPreloadInput>::from_preload_input( + #INPUT_IDENT, #NextId, #DEPENDENCIES_IDENT + ); + }) + } + _ => { + // === Input -> Self === // + Some(quote! { + let #INPUT_IDENT = >::from_preload_input( + #INPUT_IDENT, #NextId, #DEPENDENCIES_IDENT + ); + }) + } + } +} + +/// Generates a statement that sets [`INPUT_IDENT`] to a cloned instance of its +/// concrete type using `FromReflect`. +pub(crate) fn generate_from_reflect_conversion() -> TokenStream { + quote! { + let #INPUT_IDENT = ::from_reflect( + &*#Reflect::clone_value(#INPUT_IDENT) + ).unwrap_or_else(|| { + panic!( + "{} should have a functioning `FromReflect` impl", + std::any::type_name::() + ) + }); + } +} diff --git a/bevy_proto_derive/src/common/input/generate.rs b/bevy_proto_derive/src/common/input/generate.rs new file mode 100644 index 0000000..f7aa3d8 --- /dev/null +++ b/bevy_proto_derive/src/common/input/generate.rs @@ -0,0 +1,227 @@ +use proc_macro2::TokenStream; +use quote::quote; +use syn::{Error, Generics}; +use to_phantom::ToPhantom; + +use crate::common::data::{SchematicData, SchematicVariant}; +use crate::common::fields::{SchematicField, SchematicFields}; +use crate::common::input::{InputType, SchematicIo}; +use crate::utils::constants::{CONTEXT_IDENT, DEPENDENCIES_IDENT, ID_IDENT, INPUT_IDENT}; +use crate::utils::exports::{ + DependenciesBuilder, FromSchematicInput, FromSchematicPreloadInput, Reflect, SchematicContext, + SchematicId, +}; + +/// Generates the input type for the schematic. +pub(crate) fn generate_input( + io: &SchematicIo, + data: &SchematicData, + generics: &Generics, + no_preload: bool, +) -> Result, Error> { + let input_ident = match io.input_ty() { + InputType::Generated(ident) => ident, + _ => return Ok(None), + }; + + let base_ident = io.ident(); + // Defaults to the visibility of the schematic to avoid "private type in public interface" errors + let vis = io.input_vis().unwrap_or(io.vis()); + + let (impl_generics, impl_ty_generics, where_clause) = generics.split_for_impl(); + + // Ex: FooInput + let input_ty = quote!(#input_ident #impl_ty_generics); + // Ex: FooInput + let input_ty_def = quote!(#input_ident #impl_generics); + // Used to allow generics to be defined on the input type + let phantom_ty = if generics.params.is_empty() { + None + } else { + Some(generics.to_phantom()) + }; + + let make_from_impl = |body: TokenStream| { + quote! { + impl #impl_generics #FromSchematicInput<#input_ty> for #base_ident #impl_ty_generics #where_clause { + fn from_input(#INPUT_IDENT: #input_ty, #ID_IDENT: #SchematicId, #CONTEXT_IDENT: &mut #SchematicContext) -> Self { + #body + } + } + } + }; + + let make_from_preload_impl = |body: TokenStream| { + if no_preload { + None + } else { + Some(quote! { + impl #impl_generics #FromSchematicPreloadInput<#input_ty> for #base_ident #impl_ty_generics #where_clause { + fn from_preload_input(#INPUT_IDENT: #input_ty, #ID_IDENT: #SchematicId, #DEPENDENCIES_IDENT: &mut #DependenciesBuilder) -> Self { + #body + } + } + }) + } + }; + + Ok(match data { + SchematicData::Struct(SchematicFields::Unit) => { + let from_impl = make_from_impl(quote!(Self)); + let from_preload_impl = make_from_preload_impl(quote!(Self)); + + Some(quote! { + #[derive(#Reflect)] + #vis struct #input_ty_def #where_clause; + + #from_impl + + #from_preload_impl + }) + } + SchematicData::Struct(SchematicFields::Unnamed(fields)) => { + let definitions = fields + .iter() + .filter(SchematicField::requires_input_field) + .map(|field| field.generate_definition()); + + let conversions = fields + .iter() + .map(|field| field.generate_conversion(None)) + .collect::, Error>>()?; + + let from_impl = make_from_impl(quote! { + Self( + #(#conversions),* + ) + }); + + let preload_conversions = fields + .iter() + .map(|field| field.generate_preload_conversion(None)) + .collect::, Error>>()?; + + let from_preload_impl = make_from_preload_impl(quote! { + Self( + #(#preload_conversions),* + ) + }); + + let phantom_ty = phantom_ty.map(|phantom_ty| { + quote! { + #[reflect(ignore)] + #phantom_ty, + } + }); + + Some(quote! { + #[derive(#Reflect)] + #vis struct #input_ty_def ( + #(#definitions,)* + #phantom_ty + ) #where_clause; + + #from_impl + + #from_preload_impl + }) + } + SchematicData::Struct(SchematicFields::Named(fields)) => { + let definitions = fields + .iter() + .filter(SchematicField::requires_input_field) + .map(|field| field.generate_definition()); + + let members = fields + .iter() + .map(SchematicField::member) + .collect::>(); + + let conversions = fields + .iter() + .map(|field| field.generate_conversion(None)) + .collect::, Error>>()?; + + let from_impl = make_from_impl(quote! { + Self { + #(#members: #conversions),* + } + }); + + let preload_conversions = fields + .iter() + .map(|field| field.generate_preload_conversion(None)) + .collect::, Error>>()?; + + let from_preload_impl = make_from_preload_impl(quote! { + Self { + #(#members: #preload_conversions),* + } + }); + + let phantom_ty = phantom_ty.map(|phantom_ty| { + quote! { + #[reflect(ignore)] + __phantom_ty__: #phantom_ty, + } + }); + + Some(quote! { + #[derive(#Reflect)] + #vis struct #input_ty_def #where_clause { + #(#definitions,)* + #phantom_ty + } + + #from_impl + + #from_preload_impl + }) + } + SchematicData::Enum(variants) => { + let definitions = variants.iter().map(SchematicVariant::generate_definition); + + let conversions = variants + .iter() + .map(|variant| variant.generate_conversion_arm(io)) + .collect::, Error>>()?; + + let from_impl = make_from_impl(quote! { + match #INPUT_IDENT { + #(#conversions,)* + _ => unreachable!(), + } + }); + + let preload_conversions = variants + .iter() + .map(|variant| variant.generate_preload_conversion_arm(io)) + .collect::, Error>>()?; + + let from_preload_impl = make_from_preload_impl(quote! { + match #INPUT_IDENT { + #(#preload_conversions,)* + _ => unreachable!(), + } + }); + + let phantom_ty = phantom_ty.map(|phantom_ty| { + quote! { + _Phantom(#[reflect(ignore)] #phantom_ty), + } + }); + + Some(quote! { + #[derive(#Reflect)] + #vis enum #input_ty_def #where_clause { + #(#definitions,)* + #phantom_ty + } + + #from_impl + + #from_preload_impl + }) + } + }) +} diff --git a/bevy_proto_derive/src/common/input/input_ty.rs b/bevy_proto_derive/src/common/input/input_ty.rs new file mode 100644 index 0000000..0428a12 --- /dev/null +++ b/bevy_proto_derive/src/common/input/input_ty.rs @@ -0,0 +1,38 @@ +use proc_macro2::{Ident, Span, TokenStream}; +use quote::{format_ident, ToTokens}; +use syn::{Token, TypePath}; + +/// The type of the `Schematic::Input`. +#[derive(Default)] +pub(crate) enum InputType { + /// Corresponds to using `Self`. + #[default] + Reflexive, + /// Specifies an existing type. + /// + /// Most often this will be a user-generated type made to be used in attribute arguments + /// like `from = path::to::Type`. + Existing(TypePath), + /// Indicates that a new input type will need to be generated with the given identifier. + Generated(Ident), +} + +impl InputType { + /// Creates a new [`InputType::Generated`] based on the given identifier. + /// + /// The new identifier will be suffixed with `Input` + /// (e.g. `Foo` becomes `FooInput`). + pub fn new_generated(ident: &Ident) -> Self { + Self::Generated(format_ident!("{}Input", ident)) + } +} + +impl ToTokens for InputType { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self { + InputType::Reflexive => Token![Self](Span::call_site()).to_tokens(tokens), + InputType::Existing(path) => path.to_tokens(tokens), + InputType::Generated(ident) => ident.to_tokens(tokens), + } + } +} diff --git a/bevy_proto_derive/src/common/input/io.rs b/bevy_proto_derive/src/common/input/io.rs new file mode 100644 index 0000000..07edbbd --- /dev/null +++ b/bevy_proto_derive/src/common/input/io.rs @@ -0,0 +1,107 @@ +use crate::common::input::{InputType, InputVisArg, OutputType}; +use crate::utils::AttrArgValue; +use proc_macro2::{Ident, Span}; +use quote::ToTokens; +use syn::spanned::Spanned; +use syn::{DeriveInput, Error, Visibility}; + +/// The input and output types of a schematic. +/// +/// An input type is the type that the schematic is deserialized from, +/// while an output type is the type that the schematic is applied as. +pub(crate) struct SchematicIo { + /// The name of the schematic. + ident: Ident, + /// The visibility of the schematic. + vis: Visibility, + /// The visibility of the input type. + input_vis: InputVisArg, + /// The input type. + input_ty: InputType, + /// The output type. + output_ty: OutputType, +} + +impl SchematicIo { + pub fn new(input: &DeriveInput) -> Self { + Self { + ident: input.ident.clone(), + vis: input.vis.clone(), + input_vis: InputVisArg::default(), + input_ty: InputType::Reflexive, + output_ty: OutputType::Reflexive, + } + } + + /// The user-defined name of the schematic. + pub fn ident(&self) -> &Ident { + &self.ident + } + + /// The user-defined visibility of the schematic. + pub fn vis(&self) -> &Visibility { + &self.vis + } + + pub fn input_ty(&self) -> &InputType { + &self.input_ty + } + + pub fn try_set_input_ty(&mut self, value: InputType, span: Option) -> Result<(), Error> { + match &self.input_ty { + InputType::Reflexive => { + self.input_ty = value; + Ok(()) + } + InputType::Existing(ty) => { + let message = if matches!(value, InputType::Generated(_)) { + format!( + "an input type needs to be generated, but it's already specified as {}", + ty.to_token_stream() + ) + } else { + format!("input type already specified as {}", ty.to_token_stream()) + }; + Err(Error::new(span.unwrap_or_else(|| value.span()), message)) + } + InputType::Generated(ident) => Err(Error::new( + span.unwrap_or_else(|| value.span()), + format_args!("input type already specified as {}", ident), + )), + } + } + + pub fn output_ty(&self) -> &OutputType { + &self.output_ty + } + + pub fn try_set_output_ty( + &mut self, + value: OutputType, + span: Option, + ) -> Result<(), Error> { + match &self.output_ty { + OutputType::Reflexive => { + self.output_ty = value; + Ok(()) + } + OutputType::Custom(ty) => Err(Error::new( + span.unwrap_or_else(|| value.span()), + format_args!("output type already specified as {}", ty.to_token_stream()), + )), + } + } + + pub fn input_vis(&self) -> Option<&Visibility> { + self.input_vis.get() + } + + pub fn try_set_input_vis( + &mut self, + value: Visibility, + span: Option, + ) -> Result<(), Error> { + let span = span.unwrap_or_else(|| value.span()); + self.input_vis.try_set(Some(value), span) + } +} diff --git a/bevy_proto_derive/src/common/input/mod.rs b/bevy_proto_derive/src/common/input/mod.rs new file mode 100644 index 0000000..054c2e9 --- /dev/null +++ b/bevy_proto_derive/src/common/input/mod.rs @@ -0,0 +1,13 @@ +pub(crate) use attr::*; +pub(crate) use converters::*; +pub(crate) use generate::*; +pub(crate) use input_ty::*; +pub(crate) use io::*; +pub(crate) use output_ty::*; + +mod attr; +mod converters; +mod generate; +mod input_ty; +mod io; +mod output_ty; diff --git a/bevy_proto_derive/src/common/input/output_ty.rs b/bevy_proto_derive/src/common/input/output_ty.rs new file mode 100644 index 0000000..b34a2d1 --- /dev/null +++ b/bevy_proto_derive/src/common/input/output_ty.rs @@ -0,0 +1,22 @@ +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use syn::TypePath; + +/// The output type of the `Schematic` or `AssetSchematic`. +#[derive(Default)] +pub(crate) enum OutputType { + /// Outputs as `Self`. + #[default] + Reflexive, + /// Outputs as the given type. + Custom(TypePath), +} + +impl ToTokens for OutputType { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self { + Self::Reflexive => tokens.extend(quote!(Self)), + Self::Custom(ty) => tokens.extend(quote!(#ty)), + } + } +} diff --git a/bevy_proto_derive/src/common/mod.rs b/bevy_proto_derive/src/common/mod.rs new file mode 100644 index 0000000..1760cbe --- /dev/null +++ b/bevy_proto_derive/src/common/mod.rs @@ -0,0 +1,3 @@ +pub(crate) mod data; +pub(crate) mod fields; +pub(crate) mod input; diff --git a/bevy_proto_derive/src/lib.rs b/bevy_proto_derive/src/lib.rs index 18e23b2..51bc8df 100644 --- a/bevy_proto_derive/src/lib.rs +++ b/bevy_proto_derive/src/lib.rs @@ -1,10 +1,13 @@ use proc_macro::TokenStream; +use crate::asset_schematic::{DeriveAssetSchematic, ExternalAssetSchematic}; use quote::ToTokens; use syn::parse_macro_input; use crate::schematic::{DeriveSchematic, ExternalSchematic}; +mod asset_schematic; +mod common; mod schematic; mod utils; @@ -95,15 +98,41 @@ mod utils; /// /// #### Arguments /// -/// ##### `({lazy|preload})` +/// ##### `(preload)` /// /// _Optional_ /// -/// If `lazy`, then the asset won't be loaded until the schematic is actually used. -/// If `preload`, then the asset will be preloaded as a dependency of the schematic. +/// If present, then the asset will be preloaded as a dependency of the schematic. /// -/// The `lazy` variant is not strictly needed, since it corresponds to the default behavior. -/// However, it exists for users who may want the distinction to be extra explicit. +/// Cannot be used with the `unique` argument. +/// +/// ##### `(unique)` +/// +/// _Optional_ +/// +/// Note: This attribute does nothing without the `inline` argument. +/// +/// By default, when an asset is loaded inline it will only create a single asset. +/// Additional loads will point to the same asset. +/// +/// In some cases, it's desirable to have each load create a new asset. +/// This attribute allows a unique asset to be created upon each load. +/// +/// Cannot be used with the `preload` argument. +/// +/// ##### `(inline)` +/// +/// _Optional_ +/// +/// Normally, assets are defined in their own unique file and referenced by path. +/// +/// However, there are times when it would be better to define an asset inline with a schematic. +/// This attribute allows an asset to either be defined by path or inline. +/// +/// The asset type within the `Handle` or the type specified by the `type` argument must implement `AssetSchematic`. +/// This will result in the field being generated as an `InlinableProtoAsset`. +/// +/// Cannot be used with the `path` argument. /// /// ##### `(path = "path/to/asset.png")` /// @@ -114,6 +143,16 @@ mod utils; /// This can be used when a particular asset should always be used. /// When this argument is found, the corresponding field will be removed from the generated input type. /// +/// Cannot be used with the `inline` argument. +/// +/// ##### `(type = path::to::AssetType)` +/// +/// _Optional_ +/// +/// When using a typed handle, this macro will attempt to infer the asset type from the handle's type. +/// However, if this fails or if defining an asset schematic type that is not the asset itself, +/// this attribute can be used with the desired type. +/// /// ### `#[schematic(entity)]` /// /// This attribute is used with an `Entity` or `Option` field to easily setup basic entity relations. @@ -141,6 +180,14 @@ mod utils; /// - `FromSchematicInput for MyFieldType` /// /// This is useful for defining custom logic or controlling the serialized representation. +/// +/// ### `#[schematic(optional)]` +/// +/// Entity and asset fields are able to be defined as optional. +/// Normally, this macro will determine whether this is the case by the type. +/// If this fails, this attribute can be used to force the field to be optional. +/// +/// It can also be used to opt-out by specifying `#[schematic(optional = false)]`. #[proc_macro_derive(Schematic, attributes(schematic))] pub fn derive_schematic(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveSchematic); @@ -190,3 +237,67 @@ pub fn impl_external_schematic(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as ExternalSchematic); input.to_token_stream().into() } + +/// Derive the `AssetSchematic` trait. +/// +/// This macro will generate the impl for `AssetSchematic` as well as a corresponding +/// `Schematic::Input` type if one is needed. +/// +/// # Attributes +/// +/// This macro supports most of the attributes that the [`Schematic` derive macro] supports, +/// but with the `asset_schematic` namespace rather than `schematic`. +/// +/// ## Container Attributes +/// +/// This macro shares many of the same container attributes as the `Schematic` derive macro including: +/// - `#[asset_schematic(input)]` +/// - `#[asset_schematic(from = path::to::Type)]` +/// - `#[asset_schematic(into = path::to::Type)]` +/// +/// ### `#[asset_schematic(no_preload)]` +/// +/// By default, this macro will also generate the impl for `PreloadAssetSchematic` to allow +/// the asset to be preloaded. +/// +/// This is useful for assets that are used frequently and/or are small in size, +/// but sometimes this isn't always desirable or even possible. +/// +/// This attribute disables the generation of the `PreloadAssetSchematic` impl. +/// +/// ## Field Attributes +/// +/// This macro shares many of the same field attributes as the `Schematic` derive macro including: +/// - `#[asset_schematic(asset)]` +/// - `#[asset_schematic(from = path::to::FieldType)]` +/// - `#[asset_schematic(optional)]` +/// +/// For the `asset` attribute, the following arguments are supported: +/// - `(inline)` +/// - `(path = "path/to/asset.png")` +/// - `(type = path::to::AssetType)` +/// +/// [`Schematic` derive macro]: derive_schematic +#[proc_macro_derive(AssetSchematic, attributes(asset_schematic))] +pub fn derive_asset_schematic(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveAssetSchematic); + input.into_token_stream().into() +} + +/// Internal macro used to easily implement `AssetSchematic` on external types. +/// +/// Takes a type definition: +/// +/// ```ignore +/// impl_external_asset_schematic! { +/// struct SomeExternalAssetType { +/// foo: usize +/// } +/// } +/// ``` +#[doc(hidden)] +#[proc_macro] +pub fn impl_external_asset_schematic(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as ExternalAssetSchematic); + input.to_token_stream().into() +} diff --git a/bevy_proto_derive/src/schematic/container_attributes.rs b/bevy_proto_derive/src/schematic/container_attributes.rs index 7d2df28..ca860bf 100644 --- a/bevy_proto_derive/src/schematic/container_attributes.rs +++ b/bevy_proto_derive/src/schematic/container_attributes.rs @@ -1,22 +1,11 @@ use std::fmt::{Debug, Formatter}; -use proc_macro2::TokenStream; -use quote::ToTokens; +use crate::common::input::{parse_input_meta, InputType, OutputType, SchematicIo}; +use crate::utils::constants::{FROM_ATTR, INPUT_ATTR, INTO_ATTR, SCHEMATIC_ATTR}; use syn::meta::ParseNestedMeta; -use syn::spanned::Spanned; -use syn::{Attribute, Error, LitStr, Visibility}; +use syn::{Attribute, Error, LitStr}; -use crate::schematic::input::InputType; -use crate::schematic::self_type::SelfType; -use crate::schematic::utils::filter_attributes; - -const INPUT_ATTR: &str = "input"; -const INPUT_VIS: &str = "vis"; -const INPUT_NAME: &str = "name"; - -const FROM_ATTR: &str = "from"; - -const INTO_ATTR: &str = "into"; +use crate::utils::{parse_nested_meta, unsupported_arg}; const KIND_ATTR: &str = "kind"; const KIND_BUNDLE: &str = "bundle"; @@ -24,172 +13,55 @@ const KIND_RESOURCE: &str = "resource"; /// Attribute information on the container type. #[derive(Default)] -pub(crate) struct ContainerAttributes { - input_vis: Option, +pub(super) struct ContainerAttributes { kind: SchematicKind, } impl ContainerAttributes { - pub fn new( - attrs: &[Attribute], - self_ty: &mut SelfType, - input_ty: &mut InputType, - ) -> Result { - let mut data = ContainerAttributesBuilder { - attrs: Self::default(), - self_ty, - input_ty, - }; + pub fn new(attrs: &[Attribute], io: &mut SchematicIo) -> Result { + let mut this = Self::default(); - for attr in filter_attributes(attrs) { - attr.parse_nested_meta(|meta| { - if meta.path.is_ident(FROM_ATTR) { - data.try_set_input_ty(InputType::Existing(meta.value()?.parse()?)) - } else if meta.path.is_ident(INTO_ATTR) { - data.try_set_self_ty(SelfType::Into(meta.value()?.parse()?)) - } else if meta.path.is_ident(INPUT_ATTR) { - data.parse_input_meta(meta) - } else if meta.path.is_ident(KIND_ATTR) { - data.parse_kind_meta(meta) - } else { - Err(meta.error(format_args!( - "unsupported argument, expected one of: {:?}", - [INPUT_ATTR, FROM_ATTR, INTO_ATTR, KIND_ATTR] - ))) - } + for attr in attrs { + if !attr.path().is_ident(SCHEMATIC_ATTR) { + continue; + } + + parse_nested_meta!(attr, |meta| { + FROM_ATTR => io.try_set_input_ty(InputType::Existing(meta.value()?.parse()?), None), + INTO_ATTR => io.try_set_output_ty(OutputType::Custom(meta.value()?.parse()?), None), + INPUT_ATTR => parse_input_meta(meta, io), + KIND_ATTR => this.parse_kind_meta(meta), })?; } - Ok(data.attrs) - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - None - } - - pub fn input_vis(&self) -> Option<&Visibility> { - self.input_vis.as_ref() + Ok(this) } pub fn kind(&self) -> &SchematicKind { &self.kind } -} - -pub(crate) struct ContainerAttributesBuilder<'a> { - attrs: ContainerAttributes, - self_ty: &'a mut SelfType, - input_ty: &'a mut InputType, -} - -impl<'a> ContainerAttributesBuilder<'a> { - fn parse_input_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { - meta.parse_nested_meta(|meta| { - if meta.path.is_ident(INPUT_VIS) { - match &self.attrs.input_vis { - Some(vis) => Err(meta.error(format_args!( - "visibility already set to {}", - vis.to_token_stream() - ))), - None => { - self.attrs.input_vis = Some(meta.value()?.parse()?); - Ok(()) - } - } - } else if meta.path.is_ident(INPUT_NAME) { - self.try_set_input_ty(InputType::Generated(meta.value()?.parse()?)) - } else { - Err(meta.error(format_args!( - "unsupported argument, expected one of: {:?}", - [INPUT_VIS, INPUT_NAME] - ))) - } - }) - } fn parse_kind_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { - if !matches!(self.attrs.kind, SchematicKind::Undefined) { + if !matches!(self.kind, SchematicKind::Undefined) { return Err(meta.error(format_args!( "schematic kind already configured as #[schematic{:?}]", - &self.attrs.kind + &self.kind ))); } let kind: LitStr = meta.value()?.parse()?; let kind_str = kind.value(); - match kind_str.as_str() { - KIND_BUNDLE => { - self.attrs.kind = SchematicKind::Bundle; + match &kind_str { + _ if kind_str == KIND_BUNDLE => { + self.kind = SchematicKind::Bundle; Ok(()) } - KIND_RESOURCE => { - self.attrs.kind = SchematicKind::Resource; + _ if kind_str == KIND_RESOURCE => { + self.kind = SchematicKind::Resource; Ok(()) } - _ => Err(Error::new( - kind.span(), - format_args!( - "unsupported argument, expected one of: {:?}", - [KIND_BUNDLE, KIND_RESOURCE] - ), - )), - } - } - - fn try_set_input_ty(&mut self, value: InputType) -> Result<(), Error> { - match self.self_ty { - SelfType::Into(ty) => Err(Error::new( - value.span(), - format_args!( - "cannot specify input type when schematic type already set to {}", - ty.to_token_stream() - ), - )), - _ => match &self.input_ty { - InputType::Reflexive => { - *self.input_ty = value; - Ok(()) - } - InputType::Existing(ty) => Err(Error::new( - value.span(), - format_args!("input type already specified as {}", ty.to_token_stream()), - )), - InputType::Generated(ident) => Err(Error::new( - value.span(), - format_args!("input type already specified as {}", ident), - )), - }, - } - } - - fn try_set_self_ty(&mut self, value: SelfType) -> Result<(), Error> { - match self.input_ty { - InputType::Existing(ty) => Err(Error::new( - value.span(), - format_args!( - "cannot specify schematic type when input type already set to {}", - ty.to_token_stream() - ), - )), - _ => match &self.self_ty { - SelfType::Reflexive => { - *self.self_ty = value; - Ok(()) - } - SelfType::Into(ty) => Err(Error::new( - value.span(), - format_args!( - "schematic type already specified as {}", - ty.to_token_stream() - ), - )), - }, + _ => Err(unsupported_arg(&meta, Some(&[KIND_BUNDLE, KIND_RESOURCE]))), } } } diff --git a/bevy_proto_derive/src/schematic/data.rs b/bevy_proto_derive/src/schematic/data.rs deleted file mode 100644 index 1f49e1e..0000000 --- a/bevy_proto_derive/src/schematic/data.rs +++ /dev/null @@ -1,78 +0,0 @@ -use proc_macro2::{Ident, TokenStream}; -use quote::quote; -use syn::{Data, Error, Fields}; - -use crate::schematic::input::InputType; -use crate::schematic::structs::{SchematicStruct, SchematicStructBuilder}; -use crate::schematic::variants::SchematicVariant; - -/// The data of the item deriving `Schematic`. -pub(crate) enum SchematicData { - Struct(SchematicStruct), - Enum(Vec), -} - -impl SchematicData { - pub fn from_data( - data: Data, - ident: &Ident, - input_ty: &mut InputType, - proto_crate: &TokenStream, - bevy_crate: &TokenStream, - ) -> Result { - let mut builder = SchematicStructBuilder { - ident, - input_ty, - proto_crate, - bevy_crate, - }; - - let data = match data { - Data::Struct(data) => SchematicData::Struct(builder.build(data.fields)?), - Data::Enum(data) => SchematicData::Enum( - data.variants - .into_iter() - .map(|variant| { - Ok(match &variant.fields { - Fields::Named(_) => SchematicVariant { - ident: variant.ident, - data: builder.build(variant.fields)?, - }, - Fields::Unnamed(_) => SchematicVariant { - ident: variant.ident, - data: builder.build(variant.fields)?, - }, - Fields::Unit => SchematicVariant { - ident: variant.ident, - data: SchematicStruct::Unit, - }, - }) - }) - .collect::>()?, - ), - Data::Union(data) => { - return Err(Error::new(data.union_token.span, "unions not supported")) - } - }; - - Ok(data) - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - let assertions = match self { - SchematicData::Struct(data) => data.assertions(), - SchematicData::Enum(data) => data.iter().map(|variant| variant.assertions()).collect(), - }?; - - Some(quote! { - mod DataAssertions { - #assertions - } - }) - } -} diff --git a/bevy_proto_derive/src/schematic/derive.rs b/bevy_proto_derive/src/schematic/derive.rs index 03f1cc5..5d2749f 100644 --- a/bevy_proto_derive/src/schematic/derive.rs +++ b/bevy_proto_derive/src/schematic/derive.rs @@ -1,64 +1,50 @@ +use crate::common::data::{DeriveType, SchematicData}; +use crate::common::fields::SchematicFields; +use crate::common::input::{ + generate_from_reflect_conversion, generate_input, generate_input_conversion, InputType, + OutputType, SchematicIo, +}; +use crate::utils::constants::{CONTEXT_IDENT, DEPENDENCIES_IDENT, ID_IDENT, INPUT_IDENT}; +use crate::utils::exports::{DependenciesBuilder, Schematic, SchematicContext, SchematicId}; use proc_macro2::{Ident, TokenStream}; use quote::{quote, ToTokens}; use syn::parse::{Parse, ParseStream}; -use syn::{DeriveInput, Generics, Visibility}; +use syn::{DeriveInput, Error, Generics, Visibility}; use crate::schematic::container_attributes::{ContainerAttributes, SchematicKind}; -use crate::schematic::data::SchematicData; -use crate::schematic::field_attributes::ReplacementType; -use crate::schematic::idents::{CONTEXT_IDENT, DEPENDENCIES_IDENT, INPUT_IDENT}; -use crate::schematic::input::{Input, InputType}; -use crate::schematic::self_type::SelfType; -use crate::schematic::structs::SchematicStruct; -use crate::utils::{get_bevy_crate, get_proto_crate}; pub(crate) struct DeriveSchematic { attrs: ContainerAttributes, - ident: Ident, generics: Generics, data: SchematicData, - self_ty: SelfType, - input_ty: InputType, - assertions: TokenStream, - proto_crate: TokenStream, - bevy_crate: TokenStream, + io: SchematicIo, } impl DeriveSchematic { - pub fn attrs(&self) -> &ContainerAttributes { - &self.attrs - } - - pub fn ident(&self) -> &Ident { - &self.ident - } - - pub fn generics(&self) -> &Generics { + fn generics(&self) -> &Generics { &self.generics } - pub fn proto_crate(&self) -> &TokenStream { - &self.proto_crate + fn io(&self) -> &SchematicIo { + &self.io } - pub fn self_ty(&self) -> &SelfType { - &self.self_ty + fn output_ty(&self) -> &OutputType { + self.io.output_ty() } - pub fn input_ty(&self) -> &InputType { - &self.input_ty + fn input_ty(&self) -> &InputType { + self.io.input_ty() } - pub fn data(&self) -> &SchematicData { + fn data(&self) -> &SchematicData { &self.data } /// Generate the logic for `Schematic::apply`. - pub fn apply_def(&self) -> TokenStream { - let conversion = self - .input_ty - .generate_conversion(self.self_ty(), &self.proto_crate); - let construct_input = self.generate_from_reflect_input(); + fn apply_def(&self) -> TokenStream { + let from_reflect = generate_from_reflect_conversion(); + let conversion = generate_input_conversion(self.io()); let insert = if matches!(self.attrs.kind(), SchematicKind::Resource) { quote!(#CONTEXT_IDENT.world_mut().insert_resource(#INPUT_IDENT);) @@ -72,7 +58,7 @@ impl DeriveSchematic { }; quote! { - let #INPUT_IDENT = #construct_input; + #from_reflect #conversion @@ -82,154 +68,57 @@ impl DeriveSchematic { } /// Generate the logic for `Schematic::remove`. - pub fn remove_def(&self) -> TokenStream { - let self_ty = self.self_ty(); + fn remove_def(&self) -> TokenStream { + let output_ty = self.output_ty(); if matches!(self.attrs.kind(), SchematicKind::Resource) { - quote!(#CONTEXT_IDENT.world_mut().remove_resource::<#self_ty>();) + quote!(#CONTEXT_IDENT.world_mut().remove_resource::<#output_ty>();) } else { quote!( #CONTEXT_IDENT .entity_mut() .unwrap_or_else(|| panic!("schematic `{}` expected entity", std::any::type_name::())) - .remove::<#self_ty>(); + .remove::<#output_ty>(); ) } } /// Generates the logic for `Schematic::preload`. - pub fn preload_def(&self) -> Option { - let proto_crate = &self.proto_crate; - match &self.data { - SchematicData::Struct(SchematicStruct::Unit) => None, + fn preload_def(&self) -> Result { + Ok(match &self.data { + SchematicData::Struct(SchematicFields::Unit) => TokenStream::new(), SchematicData::Struct( - SchematicStruct::Named(fields) | SchematicStruct::Unnamed(fields), - ) => Some( - fields - .iter() - .filter_map(|field| match field.attrs().replacement_ty() { - ReplacementType::Asset(config) if config.is_preload() => { - let ty = field.defined_ty(); - let member = field.member(); - let name_str = field.member().to_token_stream().to_string(); - - Some(if let Some(path) = config.path() { - quote!( - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(#path); - ) - } else { - quote!( - match #INPUT_IDENT.#member { - #proto_crate::proto::ProtoAsset::AssetPath(ref path) => { - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(path.to_owned()); - } - #proto_crate::proto::ProtoAsset::HandleId(handle_id) => { - panic!( - "expected `ProtoAsset::AssetPath` in field `{}` of `{}`, but found `ProtoAsset::HandleId`", - #name_str, - ::core::any::type_name::() - ); - } - } - ) - }) - } - _ => None, - }) - .collect(), - ), + SchematicFields::Named(fields) | SchematicFields::Unnamed(fields), + ) => fields + .iter() + .map(|field| field.generate_preload(None).map(|preload| quote!(#preload))) + .collect::>()?, SchematicData::Enum(variants) => { - let input_ty = self.input_ty(); let arms = variants .iter() - .map(|variant| variant.generate_preload_arm(input_ty)); + .map(|variant| variant.generate_preload_arm(self.io())) + .collect::, Error>>()?; - Some(quote! { + quote! { match #INPUT_IDENT { - #(#arms,)* + #(#arms)* _ => unreachable!(), } - }) + } } - } - } - - /// Generates an expression that clones the `Schematic`'s input argument to - /// a `Box` using its `FromReflect`. - fn generate_from_reflect_input(&self) -> TokenStream { - let bevy_crate = &self.bevy_crate; - quote! { - ::from_reflect( - &*#bevy_crate::reflect::Reflect::clone_value(#INPUT_IDENT) - ).unwrap_or_else(|| { - panic!( - "{} should have a functioning `FromReflect` impl", - std::any::type_name::() - ) - }) - } - } -} - -impl Parse for DeriveSchematic { - fn parse(input: ParseStream) -> syn::Result { - let input = input.parse::()?; - - let mut assertions = TokenStream::new(); - - let mut self_ty = SelfType::default(); - #[cfg(feature = "assertions")] - assertions.extend(self_ty.assertions()); - - let mut input_ty = InputType::default(); - #[cfg(feature = "assertions")] - assertions.extend(input_ty.assertions()); - - let attrs = ContainerAttributes::new(&input.attrs, &mut self_ty, &mut input_ty)?; - #[cfg(feature = "assertions")] - assertions.extend(attrs.assertions()); - - let proto_crate = get_proto_crate(); - let bevy_crate = get_bevy_crate(); - - let data = SchematicData::from_data( - input.data, - &input.ident, - &mut input_ty, - &proto_crate, - &bevy_crate, - )?; - #[cfg(feature = "assertions")] - assertions.extend(data.assertions()); - - Ok(Self { - attrs, - ident: input.ident, - generics: input.generics, - data, - self_ty, - input_ty, - assertions, - proto_crate, - bevy_crate, }) } -} -impl ToTokens for DeriveSchematic { - fn to_tokens(&self, tokens: &mut TokenStream) { - let ident = self.ident(); + fn generate(&self) -> Result { + let ident: &Ident = self.io.ident(); let (impl_generics, ty_generics, where_clause) = self.generics().split_for_impl(); - let proto_crate = self.proto_crate(); - - let attrs = self.attrs(); - - let input = Input::get_input(self); + let input = generate_input(self.io(), self.data(), self.generics(), true)?; let apply_def = self.apply_def(); let remove_def = self.remove_def(); - let preload_def = self.preload_def(); + let preload_def = self.preload_def()?; + let input_vis = self.io.input_vis(); let input_ty = match self.input_ty() { InputType::Generated(ident) => { quote!(#ident #ty_generics) @@ -237,49 +126,61 @@ impl ToTokens for DeriveSchematic { input_ty => input_ty.to_token_stream(), }; - let assertions = if cfg!(feature = "assertions") { - let assertions = &self.assertions; - Some(quote! { - const _: () = { - mod Assertions { - #assertions - } - }; - }) - } else { - None - }; - let output = quote! { #input - impl #impl_generics #proto_crate::schematics::Schematic for #ident #ty_generics #where_clause { + impl #impl_generics #Schematic for #ident #ty_generics #where_clause { type Input = #input_ty; - fn apply(#INPUT_IDENT: &Self::Input, #CONTEXT_IDENT: &mut #proto_crate::schematics::SchematicContext) { + fn apply(#INPUT_IDENT: &Self::Input, #ID_IDENT: #SchematicId, #CONTEXT_IDENT: &mut #SchematicContext) { #apply_def } - fn remove(#INPUT_IDENT: &Self::Input, #CONTEXT_IDENT: &mut #proto_crate::schematics::SchematicContext) { + fn remove(#INPUT_IDENT: &Self::Input, #ID_IDENT: #SchematicId, #CONTEXT_IDENT: &mut #SchematicContext) { #remove_def } - fn preload_dependencies(#INPUT_IDENT: &mut Self::Input, #DEPENDENCIES_IDENT: &mut #proto_crate::deps::DependenciesBuilder) { + fn preload_dependencies(#INPUT_IDENT: &mut Self::Input, #ID_IDENT: #SchematicId, #DEPENDENCIES_IDENT: &mut #DependenciesBuilder) { #preload_def } } - - #assertions }; - if matches!(attrs.input_vis(), None | Some(Visibility::Inherited)) { - tokens.extend(quote! { + Ok(match input_vis { + None | Some(Visibility::Inherited) => quote! { const _: () = { #output }; - }) - } else { - tokens.extend(output); + }, + _ => output, + }) + } +} + +impl Parse for DeriveSchematic { + fn parse(input: ParseStream) -> syn::Result { + let input = input.parse::()?; + + let mut io = SchematicIo::new(&input); + + let attrs = ContainerAttributes::new(&input.attrs, &mut io)?; + + let data = SchematicData::new(input.data, &mut io, DeriveType::Schematic)?; + + Ok(Self { + attrs, + generics: input.generics, + data, + io, + }) + } +} + +impl ToTokens for DeriveSchematic { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self.generate() { + Ok(output) => tokens.extend(output), + Err(err) => err.to_compile_error().to_tokens(tokens), } } } diff --git a/bevy_proto_derive/src/schematic/field_attributes.rs b/bevy_proto_derive/src/schematic/field_attributes.rs deleted file mode 100644 index 83f55c9..0000000 --- a/bevy_proto_derive/src/schematic/field_attributes.rs +++ /dev/null @@ -1,360 +0,0 @@ -use std::fmt::{Debug, Formatter}; - -use proc_macro2::{Ident, Span, TokenStream}; -use quote::ToTokens; -use syn::meta::ParseNestedMeta; -use syn::spanned::Spanned; -use syn::{parse_quote, Attribute, Error, Field, LitStr, Type}; - -use crate::schematic::input::InputType; -use crate::schematic::ATTRIBUTE; - -const ASSET_ATTR: &str = "asset"; -const ASSET_LAZY: &str = "lazy"; -const ASSET_PRELOAD: &str = "preload"; -const ASSET_PATH: &str = "path"; - -const ENTITY_ATTR: &str = "entity"; -const ENTITY_PATH: &str = "path"; - -const FROM_ATTR: &str = "from"; - -/// Specifies how to replace a field in a generated `Schematic::Input` type. -#[derive(Default)] -pub(crate) enum ReplacementType { - /// No replacement needed. - #[default] - None, - /// This field contains a handle to an asset. - Asset(AssetConfig), - /// This field contains a reference to another entity. - Entity(EntityConfig), - From(Type), -} - -impl ReplacementType { - /// Attempts this [`ReplacementType`]. - /// - /// Returns `Ok(())` if the change is valid. - /// Returns `Err(error)` if the change is not valid, such as when trying - /// to convert to a new `ReplacementType` when already designated as a different one. - pub fn try_set(&mut self, value: Self, span: Span) -> Result<(), Error> { - match (&self, value) { - (Self::None, value) => { - *self = value; - Ok(()) - } - (Self::Entity(EntityConfig::Undefined), value @ Self::Entity(_)) => { - *self = value; - Ok(()) - } - (current, _) => Err(Error::new( - span, - format_args!("field already configured as {:?}", current), - )), - } - } - - /// Returns a generated [`Type`] to be used as a field's replacement - /// type for a generated `Schematic::Input`. - /// - /// Returns `None` for [`ReplacementType::None`], denoting that the field does not require - /// a replacement type. - pub fn generate_type(&self, proto_crate: &TokenStream) -> Option { - match self { - ReplacementType::None => None, - ReplacementType::Asset(_) => Some(parse_quote!(#proto_crate::proto::ProtoAsset)), - ReplacementType::Entity(_) => Some(parse_quote!(#proto_crate::tree::EntityAccess)), - ReplacementType::From(ty) => Some(ty.clone()), - } - } -} - -impl Debug for ReplacementType { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - ReplacementType::None => Ok(()), - ReplacementType::Asset(config) => write!(f, "#[schematic(asset{:?})]", config), - ReplacementType::Entity(config) => write!(f, "#[schematic(entity{:?})]", config), - ReplacementType::From(ty) => write!(f, "#[schematic(from = {})]", ty.to_token_stream()), - } - } -} - -/// Specifies the configuration for asset-containing fields. -#[derive(Default)] -pub(crate) struct AssetConfig { - path: Option, - load_type: AssetLoadType, -} - -impl AssetConfig { - pub fn path(&self) -> Option<&LitStr> { - self.path.as_ref() - } - - /// Returns true if the asset should be preloaded. - pub fn is_preload(&self) -> bool { - matches!(self.load_type, AssetLoadType::Preload) - } - - pub fn try_set_path(&mut self, path: LitStr, span: Span) -> Result<(), Error> { - if self.path.is_some() { - return Err(self.get_error(span)); - } - - self.path = Some(path); - - Ok(()) - } - - pub fn try_set_load_type(&mut self, load_type: AssetLoadType, span: Span) -> Result<(), Error> { - if !matches!(self.load_type, AssetLoadType::Undefined) { - return Err(self.get_error(span)); - } - - self.load_type = load_type; - - Ok(()) - } - - fn get_error(&self, span: Span) -> Error { - Error::new( - span, - format_args!("field already configured as #[schematic(asset{:?})]", self), - ) - } -} - -impl Debug for AssetConfig { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match (&self.load_type, &self.path) { - (AssetLoadType::Undefined, None) => Ok(()), - (load_type, None) => write!(f, "({:?})", load_type), - (AssetLoadType::Undefined, Some(path)) => { - write!(f, "(path = {:?})", path.value()) - } - (load_type, Some(path)) => { - write!(f, "({:?}, path = {:?})", load_type, path.value()) - } - } - } -} - -#[derive(Default)] -pub(crate) enum AssetLoadType { - #[default] - Undefined, - Preload, - Lazy, -} - -impl Debug for AssetLoadType { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Self::Undefined => Ok(()), - Self::Preload => write!(f, "preload"), - Self::Lazy => write!(f, "lazy"), - } - } -} - -#[derive(Default)] -pub(crate) enum EntityConfig { - #[default] - Undefined, - Path(LitStr), -} - -impl Debug for EntityConfig { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - EntityConfig::Undefined => Ok(()), - EntityConfig::Path(path) => write!(f, "(path = {:?})", path.value()), - } - } -} - -#[derive(Default)] -pub(crate) struct FieldAttributes { - reflect_attrs: Vec, - replacement_ty: ReplacementType, -} - -impl FieldAttributes { - /// Create a [`FieldAttributes`] for the given field. - /// - /// # Arguments - /// - /// * `field`: The field to process - /// * `ident`: The [`Ident`] of the `Schematic` - /// * `input_ty`: A mutable reference to the [`InputType`] of the `Schematic` - /// - pub fn new(field: &Field, ident: &Ident, input_ty: &mut InputType) -> Result { - let mut data = FieldAttributesBuilder { - attrs: Self::default(), - ident, - input_ty, - }; - - for attr in &field.attrs { - if attr.path().is_ident("reflect") { - data.attrs.reflect_attrs.push(attr.clone()); - } - - if !attr.path().is_ident(ATTRIBUTE) { - continue; - } - - attr.parse_nested_meta(|meta| { - let ident = meta - .path - .get_ident() - .ok_or_else(|| Error::new(meta.path.span(), "unsupported argument"))? - .to_string(); - - match (ident.as_str(), &data.input_ty) { - (attr @ (ASSET_ATTR | ENTITY_ATTR | FROM_ATTR), InputType::Existing(ty)) => { - Err(meta.error(format_args!( - "cannot use #[schematic({})] when input type is already defined as {}", - attr, - ty.to_token_stream() - ))) - } - (ASSET_ATTR, _) => data.parse_asset_meta(meta), - (ENTITY_ATTR, _) => data.parse_entity_meta(meta), - (FROM_ATTR, _) => data.parse_from_meta(meta), - (_, _) => Err(meta.error(format_args!( - "unsupported argument, expected one of: {:?}", - [ASSET_ATTR, ENTITY_ATTR, FROM_ATTR] - ))), - } - })?; - } - - Ok(data.attrs) - } - - /// The field's [`ReplacementType`]. - pub fn replacement_ty(&self) -> &ReplacementType { - &self.replacement_ty - } - - /// Reflection attributes to pass to the generated input. - pub fn reflect_attrs(&self) -> &[Attribute] { - &self.reflect_attrs - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - None - } -} - -struct FieldAttributesBuilder<'a> { - attrs: FieldAttributes, - ident: &'a Ident, - input_ty: &'a mut InputType, -} - -impl<'a> FieldAttributesBuilder<'a> { - /// Parse a `#[schematic(asset)]` attribute. - /// - /// This takes in the meta starting at `asset`. - fn parse_asset_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { - self.require_input(meta.path.span())?; - - let config = if let ReplacementType::Asset(config) = &mut self.attrs.replacement_ty { - config - } else { - self.attrs.replacement_ty.try_set( - ReplacementType::Asset(AssetConfig::default()), - meta.path.span(), - )?; - let ReplacementType::Asset(config) = &mut self.attrs.replacement_ty else { - unreachable!() - }; - config - }; - - if meta.input.is_empty() { - return Ok(()); - } - - meta.parse_nested_meta(|meta| { - if meta.path.is_ident(ASSET_LAZY) { - config.try_set_load_type(AssetLoadType::Lazy, meta.input.span()) - } else if meta.path.is_ident(ASSET_PRELOAD) { - config.try_set_load_type(AssetLoadType::Preload, meta.input.span()) - } else if meta.path.is_ident(ASSET_PATH) { - config.try_set_path(meta.value()?.parse()?, meta.input.span()) - } else { - Err(meta.error(format_args!( - "unsupported argument, expected one of: {:?}", - [ASSET_LAZY, ASSET_PRELOAD, ASSET_PATH] - ))) - } - }) - } - - /// Parse a `#[schematic(entity)]` attribute. - /// - /// This takes in the meta starting at `entity`. - fn parse_entity_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { - self.attrs.replacement_ty.try_set( - ReplacementType::Entity(EntityConfig::Undefined), - meta.path.span(), - )?; - self.require_input(meta.path.span())?; - - if meta.input.is_empty() { - return Ok(()); - } - - meta.parse_nested_meta(|meta| { - let config = if meta.path.is_ident(ENTITY_PATH) { - EntityConfig::Path(meta.value()?.parse()?) - } else { - return Err(meta.error(format_args!( - "unsupported argument, expected one of: {:?}", - [ENTITY_PATH] - ))); - }; - - self.attrs - .replacement_ty - .try_set(ReplacementType::Entity(config), meta.input.span()) - }) - } - - /// Parse a `#[schematic(from)]` attribute. - /// - /// This takes in the meta starting at `from`. - fn parse_from_meta(&mut self, meta: ParseNestedMeta) -> Result<(), Error> { - self.require_input(meta.path.span())?; - - self.attrs.replacement_ty.try_set( - ReplacementType::From(meta.value()?.parse()?), - meta.input.span(), - ) - } - - /// Method used to require that a `Schematic::Input` type be generated for the attribute - /// (identified by the given [`Span`]). - fn require_input(&mut self, span: Span) -> Result<(), Error> { - match &self.input_ty { - InputType::Reflexive => { - *self.input_ty = InputType::new_generated(self.ident); - Ok(()) - } - InputType::Existing(ty) => Err(Error::new(span, format_args!("attribute requires input type generation, but the input type is already specified as {}", ty.to_token_stream()))), - InputType::Generated(_) => { - Ok(()) - } - } - } -} diff --git a/bevy_proto_derive/src/schematic/fields.rs b/bevy_proto_derive/src/schematic/fields.rs deleted file mode 100644 index f2c5c62..0000000 --- a/bevy_proto_derive/src/schematic/fields.rs +++ /dev/null @@ -1,177 +0,0 @@ -use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; -use syn::{Member, Type}; - -use crate::schematic::field_attributes::{EntityConfig, FieldAttributes, ReplacementType}; -use crate::schematic::idents::{CONTEXT_IDENT, INPUT_IDENT}; - -/// Field data for a `Schematic`. -/// -/// The [`ToTokens`] impl for this type will generate the field definitions for a -/// generated `Schematic::Input` type, and will automatically use the field's -/// [`ReplacementType`], if any. -pub(crate) struct SchematicField { - attrs: FieldAttributes, - member: Member, - ty: Type, - replacement_ty: Option, - bevy_crate: TokenStream, - proto_crate: TokenStream, -} - -impl SchematicField { - pub fn new>( - attrs: FieldAttributes, - member: M, - ty: Type, - proto_crate: &TokenStream, - bevy_crate: &TokenStream, - ) -> Self { - let replacement_ty = attrs.replacement_ty().generate_type(proto_crate); - - Self { - attrs, - member: member.into(), - ty, - replacement_ty, - bevy_crate: bevy_crate.clone(), - proto_crate: proto_crate.clone(), - } - } - - /// The field's `#[schematic]` attributes. - pub fn attrs(&self) -> &FieldAttributes { - &self.attrs - } - - /// The member (ident or index) used to access this field. - pub fn member(&self) -> &Member { - &self.member - } - - /// The type of the field, as defined by the user. - pub fn defined_ty(&self) -> &Type { - &self.ty - } - - /// The type of the field, as determined by its [`ReplacementType`]. - /// - /// If there is no replacement type, returns `None`. - pub fn replacement_ty(&self) -> Option<&Type> { - self.replacement_ty.as_ref() - } - - pub fn bevy_crate(&self) -> &TokenStream { - &self.bevy_crate - } - - pub fn proto_crate(&self) -> &TokenStream { - &self.proto_crate - } - - /// Generate the conversion from the field to its [`ReplacementType`]. - pub fn conversion_def(&self) -> TokenStream { - let proto_crate = &self.proto_crate; - let bevy_crate = &self.bevy_crate; - let member = &self.member; - let ty = &self.ty; - - match self.attrs().replacement_ty() { - ReplacementType::None => quote!(#INPUT_IDENT.#member), - ReplacementType::Asset(config) => { - if let Some(path) = config.path() { - quote!( - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .load(#path) - ) - } else { - quote!( - match #INPUT_IDENT.#member { - #proto_crate::proto::ProtoAsset::AssetPath(ref path) => { - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .load(path) - } - #proto_crate::proto::ProtoAsset::HandleId(handle_id) => { - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .get_handle(handle_id) - } - } - ) - } - } - replacement_ty @ ReplacementType::Entity(EntityConfig::Undefined) => { - let entity_ty = replacement_ty.generate_type(proto_crate).unwrap(); - quote! { - <#ty as #proto_crate::schematics::FromSchematicInput<#entity_ty>>::from_input( - #INPUT_IDENT.#member, - #CONTEXT_IDENT, - ) - } - } - replacement_ty @ ReplacementType::Entity(EntityConfig::Path(path)) => { - let entity_ty = replacement_ty.generate_type(proto_crate).unwrap(); - quote! { - <#ty as #proto_crate::schematics::FromSchematicInput<#entity_ty>>::from_input( - #proto_crate::tree::EntityAccess::from(#path), - #CONTEXT_IDENT, - ) - } - } - ReplacementType::From(replacement_ty) => quote! { - <#ty as #proto_crate::schematics::FromSchematicInput<#replacement_ty>>::from_input( - #INPUT_IDENT.#member, - #CONTEXT_IDENT, - ) - }, - } - } - - /// Returns true if this field should be included in a generated input's type definition. - pub fn should_generate(self: &&Self) -> bool { - match self.attrs().replacement_ty() { - ReplacementType::Asset(config) if config.path().is_some() => false, - ReplacementType::Entity(EntityConfig::Path(_)) => false, - _ => true, - } - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - self.attrs().assertions() - } - - /// Takes a list of fields and returns an iterator over their struct/enum definition stream. - /// - /// This will automatically filter out any field that [should not be generated]. - /// - /// [should not be generated]: Self::should_generate - pub fn iter_definitions(fields: &[Self]) -> impl Iterator + '_ { - fields.iter().filter(Self::should_generate).map(|field| { - let attrs = field.attrs().reflect_attrs(); - quote! { - #(#attrs)* - #field - } - }) - } -} - -impl ToTokens for SchematicField { - fn to_tokens(&self, tokens: &mut TokenStream) { - let ty = self.replacement_ty().unwrap_or(&self.ty); - tokens.extend(match &self.member { - Member::Named(ident) => quote!(#ident: #ty), - Member::Unnamed(_) => quote!(#ty), - }) - } -} diff --git a/bevy_proto_derive/src/schematic/idents.rs b/bevy_proto_derive/src/schematic/idents.rs deleted file mode 100644 index 393f9a5..0000000 --- a/bevy_proto_derive/src/schematic/idents.rs +++ /dev/null @@ -1,27 +0,0 @@ -//! Helper [idents] used in generated macro output. -//! -//! The purpose of these idents is to use their const-likeness so that we -//! can easily make use of them throughout modules without having to pass -//! them around as references (since these should never change). -//! -//! [idents]: Ident - -use proc_macro2::{Ident, Span, TokenStream}; -use quote::ToTokens; - -/// Ident for the `Schematic::Input` argument. -pub(crate) const INPUT_IDENT: ConstIdent = ConstIdent("__input__"); -/// Ident for the `SchematicContext` argument. -pub(crate) const CONTEXT_IDENT: ConstIdent = ConstIdent("__context__"); -/// Ident for the `DependenciesBuilder` argument. -pub(crate) const DEPENDENCIES_IDENT: ConstIdent = ConstIdent("__dependencies__"); - -/// Helper struct used to generate a const-like [`Ident`] with the given name. -#[derive(Copy, Clone, PartialEq)] -pub(crate) struct ConstIdent(&'static str); - -impl ToTokens for ConstIdent { - fn to_tokens(&self, tokens: &mut TokenStream) { - Ident::new(self.0, Span::call_site()).to_tokens(tokens) - } -} diff --git a/bevy_proto_derive/src/schematic/input.rs b/bevy_proto_derive/src/schematic/input.rs deleted file mode 100644 index 2694b92..0000000 --- a/bevy_proto_derive/src/schematic/input.rs +++ /dev/null @@ -1,238 +0,0 @@ -use proc_macro2::{Ident, Span, TokenStream}; -use quote::{format_ident, quote, ToTokens}; -use syn::token::Pub; -use syn::{Generics, Token, TypePath, Visibility}; -use to_phantom::ToPhantom; - -use crate::schematic::data::SchematicData; -use crate::schematic::fields::SchematicField; -use crate::schematic::idents::{CONTEXT_IDENT, INPUT_IDENT}; -use crate::schematic::self_type::SelfType; -use crate::schematic::structs::SchematicStruct; -use crate::schematic::DeriveSchematic; -use crate::utils::{get_bevy_crate, get_proto_crate}; - -/// The type of the `Schematic::Input`. -#[derive(Default)] -pub(crate) enum InputType { - /// Corresponds to using `Self`. - #[default] - Reflexive, - /// Specifies an existing type. - /// - /// Most often this will be a user-generated type made to be used in `#[schematic(from = path::to::Type)]`. - Existing(TypePath), - Generated(Ident), -} - -impl InputType { - pub fn new_generated(ident: &Ident) -> Self { - Self::Generated(format_ident!("{}Input", ident)) - } - - /// Generates a conversion statement from the [`InputType`] to the `Schematic`'s type. - /// - /// If no conversion is necessary, returns `None`. - pub fn generate_conversion( - &self, - self_ty: &SelfType, - proto_crate: &TokenStream, - ) -> Option { - match (self, self_ty) { - (InputType::Reflexive, SelfType::Reflexive) => None, - (_, SelfType::Into(self_ty)) => Some(quote! { - let #INPUT_IDENT = >::from_input( - #INPUT_IDENT, #CONTEXT_IDENT - ); - let #INPUT_IDENT = <#self_ty as #proto_crate::schematics::FromSchematicInput>::from_input( - #INPUT_IDENT, #CONTEXT_IDENT - ); - }), - _ => Some(quote! { - let #INPUT_IDENT = >::from_input(#INPUT_IDENT, #CONTEXT_IDENT); - }), - } - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - None - } -} - -impl ToTokens for InputType { - fn to_tokens(&self, tokens: &mut TokenStream) { - match self { - InputType::Reflexive => Token![Self](Span::call_site()).to_tokens(tokens), - InputType::Existing(path) => path.to_tokens(tokens), - InputType::Generated(ident) => ident.to_tokens(tokens), - } - } -} - -/// A temp struct used to generate a `Schematic::Input` type. -pub(crate) struct Input<'a> { - vis: Visibility, - base_ident: &'a Ident, - input_ident: &'a Ident, - generics: &'a Generics, - data: &'a SchematicData, -} - -impl<'a> Input<'a> { - /// Returns the [`Input`] definition used to generate a `Schematic::Input` type. - /// - /// This will return `None` if no type needs to be generated. - pub fn get_input(derive_data: &'a DeriveSchematic) -> Option> { - let vis = derive_data - .attrs() - .input_vis() - .cloned() - .unwrap_or(Visibility::Public(Pub::default())); - - match derive_data.input_ty() { - InputType::Generated(ident) => Some(Self { - vis, - base_ident: derive_data.ident(), - input_ident: ident, - generics: derive_data.generics(), - data: derive_data.data(), - }), - _ => None, - } - } -} - -impl<'a> ToTokens for Input<'a> { - fn to_tokens(&self, tokens: &mut TokenStream) { - let proto_crate = get_proto_crate(); - let bevy_crate = get_bevy_crate(); - - let vis = &self.vis; - let base_ty = self.base_ident; - let input_ident = self.input_ident; - let (impl_generics, impl_ty_generics, where_clause) = self.generics.split_for_impl(); - - // Ex: Foo - let input_ty = quote!(#input_ident #impl_ty_generics); - // Ex: Foo - let input_ty_def = quote!(#input_ident #impl_generics); - let phantom_ty = if self.generics.params.is_empty() { - None - } else { - Some(self.generics.to_phantom()) - }; - - let make_from_impl = |body: TokenStream| { - quote! { - impl #impl_generics #proto_crate::schematics::FromSchematicInput<#input_ty> for #base_ty #impl_ty_generics #where_clause { - fn from_input( - #INPUT_IDENT: #input_ty, - #CONTEXT_IDENT: &mut #proto_crate::schematics::SchematicContext - ) -> Self { - #body - } - } - } - }; - - match self.data { - SchematicData::Struct(SchematicStruct::Unit) => { - let from_impl = make_from_impl(quote!(Self)); - - tokens.extend(quote! { - #[derive(#bevy_crate::prelude::Reflect)] - #vis struct #input_ty_def #where_clause; - - #from_impl - }) - } - SchematicData::Struct(SchematicStruct::Unnamed(fields)) => { - let conversions = fields.iter().map(SchematicField::conversion_def); - let filtered = SchematicField::iter_definitions(fields); - let from_impl = make_from_impl(quote! { - Self( - #(#conversions),* - ) - }); - - let phantom_ty = phantom_ty.map(|phantom_ty| { - quote! { - #[reflect(ignore)] - #phantom_ty - } - }); - - tokens.extend(quote! { - #[derive(#bevy_crate::prelude::Reflect)] - #vis struct #input_ty_def ( - #(#filtered,)* - #phantom_ty - ) #where_clause; - - #from_impl - }) - } - SchematicData::Struct(SchematicStruct::Named(fields)) => { - let conversions = fields.iter().map(SchematicField::conversion_def); - let members = fields.iter().map(SchematicField::member); - let filtered = SchematicField::iter_definitions(fields); - - let from_impl = make_from_impl(quote! { - Self { - #(#members: #conversions),* - } - }); - - let phantom_ty = phantom_ty.map(|phantom_ty| { - quote! { - #[reflect(ignore)] - __phantom_ty__: #phantom_ty - } - }); - - tokens.extend(quote! { - #[derive(#bevy_crate::prelude::Reflect)] - #vis struct #input_ty_def #where_clause { - #(#filtered,)* - #phantom_ty - } - - #from_impl - }) - } - SchematicData::Enum(variants) => { - let constructors = variants - .iter() - .map(|variant| variant.generate_constructor_arm(input_ident)); - - let from_impl = make_from_impl(quote! { - match #INPUT_IDENT { - #(#constructors,)* - _ => unreachable!(), - } - }); - - let phantom_ty = phantom_ty.map(|phantom_ty| { - quote! { - _Phantom(#[reflect(ignore)] #phantom_ty) - } - }); - - tokens.extend(quote! { - #[derive(#bevy_crate::prelude::Reflect)] - #vis enum #input_ty_def #where_clause { - #(#variants,)* - #phantom_ty - } - - #from_impl - }) - } - } - } -} diff --git a/bevy_proto_derive/src/schematic/mod.rs b/bevy_proto_derive/src/schematic/mod.rs index 1c23bc6..1fe1e1a 100644 --- a/bevy_proto_derive/src/schematic/mod.rs +++ b/bevy_proto_derive/src/schematic/mod.rs @@ -1,17 +1,6 @@ pub(crate) use derive::DeriveSchematic; pub(crate) use external::ExternalSchematic; -const ATTRIBUTE: &str = "schematic"; - mod container_attributes; -mod data; mod derive; mod external; -mod field_attributes; -mod fields; -mod idents; -mod input; -mod self_type; -mod structs; -mod utils; -mod variants; diff --git a/bevy_proto_derive/src/schematic/self_type.rs b/bevy_proto_derive/src/schematic/self_type.rs deleted file mode 100644 index eb84340..0000000 --- a/bevy_proto_derive/src/schematic/self_type.rs +++ /dev/null @@ -1,45 +0,0 @@ -use proc_macro2::TokenStream; -use quote::{quote, ToTokens}; -use syn::TypePath; - -/// The type of the `Schematic`. -#[derive(Default)] -pub(crate) enum SelfType { - /// Corresponds to using `Self`. - #[default] - Reflexive, - /// Specifies that the input type is `Self` but must be converted to the given type. - Into(TypePath), -} - -impl SelfType { - /// Returns the "true" type of the schematic (i.e. `Self`). - pub fn get_true_self(&self) -> TokenStream { - quote!(Self) - } - - /// Returns the "into" type of the schematic. - /// - /// This is the type actually being applied to the entity/world. - pub fn get_into_self(&self) -> TokenStream { - match self { - Self::Reflexive => self.get_true_self(), - Self::Into(ty) => ty.to_token_stream(), - } - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - None - } -} - -impl ToTokens for SelfType { - fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.extend(self.get_into_self()); - } -} diff --git a/bevy_proto_derive/src/schematic/structs.rs b/bevy_proto_derive/src/schematic/structs.rs deleted file mode 100644 index f7bd2c5..0000000 --- a/bevy_proto_derive/src/schematic/structs.rs +++ /dev/null @@ -1,74 +0,0 @@ -use proc_macro2::{Ident, TokenStream}; -use syn::{Error, Fields}; - -use crate::schematic::field_attributes::FieldAttributes; -use crate::schematic::fields::SchematicField; -use crate::schematic::input::InputType; - -pub(crate) enum SchematicStruct { - Unit, - Unnamed(Vec), - Named(Vec), -} - -impl SchematicStruct { - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - match self { - SchematicStruct::Unit => None, - SchematicStruct::Named(fields) | SchematicStruct::Unnamed(fields) => { - fields.iter().map(|field| field.assertions()).collect() - } - } - } -} - -pub(crate) struct SchematicStructBuilder<'a> { - pub ident: &'a Ident, - pub input_ty: &'a mut InputType, - pub proto_crate: &'a TokenStream, - pub bevy_crate: &'a TokenStream, -} - -impl<'a> SchematicStructBuilder<'a> { - pub fn build(&mut self, fields: Fields) -> Result { - Ok(match fields { - Fields::Named(fields) => SchematicStruct::Named( - fields - .named - .into_iter() - .map(|field| { - Ok(SchematicField::new( - FieldAttributes::new(&field, self.ident, self.input_ty)?, - field.ident.unwrap(), - field.ty, - self.proto_crate, - self.bevy_crate, - )) - }) - .collect::>()?, - ), - Fields::Unnamed(fields) => SchematicStruct::Unnamed( - fields - .unnamed - .into_iter() - .enumerate() - .map(|(index, field)| { - Ok(SchematicField::new( - FieldAttributes::new(&field, self.ident, self.input_ty)?, - index, - field.ty, - self.proto_crate, - self.bevy_crate, - )) - }) - .collect::>()?, - ), - Fields::Unit => SchematicStruct::Unit, - }) - } -} diff --git a/bevy_proto_derive/src/schematic/utils.rs b/bevy_proto_derive/src/schematic/utils.rs deleted file mode 100644 index bd1755e..0000000 --- a/bevy_proto_derive/src/schematic/utils.rs +++ /dev/null @@ -1,14 +0,0 @@ -use syn::Attribute; - -use crate::schematic::ATTRIBUTE; - -/// Filters the given attributes down to only the attributes used by [`Schematic`]. -/// -/// [`Schematic`]: crate::Schematic -pub(crate) fn filter_attributes<'a>( - attrs: impl IntoIterator, -) -> impl Iterator { - attrs - .into_iter() - .filter(|attr| attr.path().is_ident(ATTRIBUTE)) -} diff --git a/bevy_proto_derive/src/schematic/variants.rs b/bevy_proto_derive/src/schematic/variants.rs deleted file mode 100644 index 718b0a6..0000000 --- a/bevy_proto_derive/src/schematic/variants.rs +++ /dev/null @@ -1,249 +0,0 @@ -use proc_macro2::{Ident, TokenStream}; -use quote::{format_ident, quote, ToTokens}; -use syn::Member; - -use crate::schematic::field_attributes::{EntityConfig, ReplacementType}; -use crate::schematic::fields::SchematicField; -use crate::schematic::idents::{CONTEXT_IDENT, DEPENDENCIES_IDENT}; -use crate::schematic::input::InputType; -use crate::schematic::structs::SchematicStruct; - -pub(crate) struct SchematicVariant { - pub ident: Ident, - pub data: SchematicStruct, -} - -impl SchematicVariant { - pub fn generate_constructor_arm(&self, input_ty: &Ident) -> TokenStream { - let ident = &self.ident; - match &self.data { - SchematicStruct::Unit => quote! { - #input_ty::#ident => Self::#ident - }, - SchematicStruct::Unnamed(fields) => { - let pat = fields - .iter() - .filter(SchematicField::should_generate) - .map(|field| format_ident!("field_{}", field.member())); - - let field = fields.iter().map(|field| { - let ident = format_ident!("field_{}", field.member()); - let member = Member::Named(ident); - self.convert_field(field, Some(&member)) - }); - - quote! { - #input_ty::#ident( #(#pat,)* .. ) => Self::#ident( #(#field),* ) - } - } - SchematicStruct::Named(fields) => { - let pat = fields - .iter() - .filter(SchematicField::should_generate) - .map(|field| field.member()); - let member = fields.iter().map(|field| field.member()); - let conversions = fields.iter().map(|field| self.convert_field(field, None)); - - quote! { - #input_ty::#ident{ #(#pat,)* .. } => Self::#ident{ #(#member: #conversions),* } - } - } - } - } - - pub fn generate_preload_arm(&self, input_ty: &InputType) -> TokenStream { - let ident = &self.ident; - let ident_str = ident.to_string(); - match &self.data { - SchematicStruct::Unit => quote! { - #input_ty::#ident => {} - }, - SchematicStruct::Unnamed(fields) => { - let (pat, stmt): (Vec<_>, Vec<_>) = fields - .iter() - .filter_map(|field| match field.attrs().replacement_ty() { - ReplacementType::Asset(config) if config.is_preload() => { - let proto_crate = field.proto_crate(); - let ty = field.defined_ty(); - let member = field.member(); - let name = format_ident!("field_{}", member); - let name_str = member.to_token_stream().to_string(); - - Some(if let Some(path) = config.path() { - ( - None, - quote! { - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(#path); - }, - ) - } else { - ( - Some(quote!(#member: #name,)), - quote! { - match #name { - #proto_crate::proto::ProtoAsset::AssetPath(ref path) => { - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(path.to_owned()); - } - #proto_crate::proto::ProtoAsset::HandleId(handle_id) => { - panic!( - "expected `ProtoAsset::AssetPath` in field `{}` of `{}::{}`, but found `ProtoAsset::HandleId`", - #name_str, - ::core::any::type_name::(), - #ident_str - ); - } - } - }, - ) - }) - } - _ => None, - }) - .unzip(); - - quote! { - #input_ty::#ident{ #(#pat)* .. } => { #(#stmt)* } - } - } - SchematicStruct::Named(fields) => { - let (pat, stmt): (Vec<_>, Vec<_>) = fields - .iter() - .filter_map(|field| match field.attrs().replacement_ty() { - ReplacementType::Asset(config) if config.is_preload() => { - let proto_crate = field.proto_crate(); - let ty = field.defined_ty(); - let member = field.member(); - let name_str = member.to_token_stream().to_string(); - - Some(if let Some(path) = config.path() { - ( - None, - quote! { - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(#path); - }, - ) - } else { - ( - Some(quote!(#member,)), - quote! { - match #member { - #proto_crate::proto::ProtoAsset::AssetPath(ref path) => { - let _: #ty = #DEPENDENCIES_IDENT.add_dependency(path.to_owned()); - } - #proto_crate::proto::ProtoAsset::HandleId(handle_id) => { - panic!( - "expected `ProtoAsset::AssetPath` in field `{}` of `{}::{}`, but found `ProtoAsset::HandleId`", - #name_str, - ::core::any::type_name::(), - #ident_str - ); - } - } - }, - ) - }) - } - _ => None, - }) - .unzip(); - - quote! { - #input_ty::#ident{ #(#pat)* .. } => { #(#stmt)* } - } - } - } - } - - fn convert_field(&self, field: &SchematicField, field_name: Option<&Member>) -> TokenStream { - let proto_crate = field.proto_crate(); - let bevy_crate = field.bevy_crate(); - let member = field_name.unwrap_or_else(|| field.member()); - let ty = field.defined_ty(); - - match field.attrs().replacement_ty() { - ReplacementType::None => quote!(#member), - ReplacementType::Asset(config) => { - if let Some(path) = config.path() { - quote!( - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .load(#path) - ) - } else { - quote!( - match #member { - #proto_crate::proto::ProtoAsset::AssetPath(ref path) => { - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .load(path) - } - #proto_crate::proto::ProtoAsset::HandleId(handle_id) => { - #CONTEXT_IDENT - .world() - .resource::<#bevy_crate::asset::AssetServer>() - .get_handle(handle_id) - } - } - ) - } - } - ReplacementType::Entity(EntityConfig::Undefined) => quote! { - #CONTEXT_IDENT - .find_entity(&#member) - .unwrap_or_else(|| panic!("entity should exist at path {:?}", &#member)) - }, - ReplacementType::Entity(EntityConfig::Path(path)) => quote! { - #CONTEXT_IDENT - .find_entity(&#proto_crate::tree::EntityAccess::from(#path)) - .unwrap_or_else(|| panic!("entity should exist at path {:?}", #path)) - }, - ReplacementType::From(replacement_ty) => quote! { - <#ty as #proto_crate::schematics::FromSchematicInput<#replacement_ty>>::from_input( - #member, - #CONTEXT_IDENT, - ) - }, - } - } - - /// Compile-time assertions, if any. - /// - /// These are generated within an anonymous context and should either: - /// 1. Enforce invariants at runtime - /// 2. Provide clearer error outputs for users - pub fn assertions(&self) -> Option { - let assertions = self.data.assertions()?; - let mod_ident = format_ident!("{}VariantAssertions", self.ident); - - Some(quote! { - mod #mod_ident { - #assertions - } - }) - } -} - -impl ToTokens for SchematicVariant { - fn to_tokens(&self, tokens: &mut TokenStream) { - let ident = &self.ident; - match &self.data { - SchematicStruct::Unit => ident.to_tokens(tokens), - SchematicStruct::Unnamed(fields) => { - let filtered = SchematicField::iter_definitions(fields); - - tokens.extend(quote! { - #ident( #(#filtered),* ) - }) - } - SchematicStruct::Named(fields) => { - let filtered = SchematicField::iter_definitions(fields); - - tokens.extend(quote! { - #ident{ #(#filtered),* } - }) - } - } - } -} diff --git a/bevy_proto_derive/src/utils.rs b/bevy_proto_derive/src/utils.rs deleted file mode 100644 index 0a9d654..0000000 --- a/bevy_proto_derive/src/utils.rs +++ /dev/null @@ -1,33 +0,0 @@ -use proc_macro2::{Ident, Span, TokenStream}; -use proc_macro_crate::{crate_name, Error, FoundCrate}; -use quote::quote; - -/// Returns a path to either the `bevy_proto_backend` crate or `bevy_proto::backend` module. -pub(crate) fn get_proto_crate() -> TokenStream { - match crate_name("bevy_proto_backend") { - Ok(found_crate) => get_crate_path(found_crate), - Err(Error::CrateNotFound { .. }) => { - let path = get_crate_path( - crate_name("bevy_proto") - .expect("bevy_proto or bevy_proto_backend should be present in `Cargo.toml`"), - ); - quote!(#path::backend) - } - Err(error) => panic!("{}", error), - } -} - -/// Returns a path to the `bevy` crate. -pub(crate) fn get_bevy_crate() -> TokenStream { - get_crate_path(crate_name("bevy").expect("bevy is present in `Cargo.toml`")) -} - -fn get_crate_path(found_crate: FoundCrate) -> TokenStream { - match found_crate { - FoundCrate::Itself => quote!(crate), - FoundCrate::Name(name) => { - let ident = Ident::new(&name, Span::call_site()); - quote!( ::#ident ) - } - } -} diff --git a/bevy_proto_derive/src/utils/attr.rs b/bevy_proto_derive/src/utils/attr.rs new file mode 100644 index 0000000..ea4d8ea --- /dev/null +++ b/bevy_proto_derive/src/utils/attr.rs @@ -0,0 +1,131 @@ +use proc_macro2::Span; +use quote::ToTokens; +use std::fmt::{Debug, Formatter}; +use syn::Error; + +/// Defines the basic information for an attribute argument. +pub(crate) trait AttrArg { + /// The name of the attribute argument. + const NAME: &'static str; + /// The target of the attribute argument. + /// + /// This is used for error messages. + const TARGET: AttrTarget = AttrTarget::Field; +} + +/// Defines common value-handling methods for an attribute argument. +pub(crate) trait AttrArgValue: AttrArg + Debug { + /// The type of the value this argument expects. + type Value: ToTokens; + + fn new(value: Option) -> Self; + + fn get(&self) -> Option<&Self::Value>; + + fn set(&mut self, value: Option); + + /// Tries to set the value of this argument. + /// + /// Returns an error if the argument is already configured. + fn try_set(&mut self, value: Option, span: Span) -> Result<(), Error> { + if self.get().is_some() { + Err(self.already_configured_error(value.as_ref(), span)) + } else { + self.set(value); + Ok(()) + } + } + + /// Generates an error for when this argument is already configured. + #[allow(unused_variables)] + fn already_configured_error(&self, new: Option<&Self::Value>, span: Span) -> Error { + Error::new( + span, + format_args!("{:?} already configured as `{:?}`", Self::TARGET, self), + ) + } + + /// Generates an error for when this argument is used with another argument + /// that it cannot be used with. + fn invariant_error(&self, span: Span) -> Error { + Error::new( + span, + format_args!("cannot use `{}` argument with `{}`", Self::NAME, T::NAME,), + ) + } +} + +/// The target of the attribute argument. +/// +/// This is used for error messages. +#[derive(Default)] +pub(crate) enum AttrTarget { + #[default] + Field, + Asset, + Input, + InputVisibility, +} + +impl Debug for AttrTarget { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + AttrTarget::Field => write!(f, "field"), + AttrTarget::Asset => write!(f, "asset"), + AttrTarget::Input => write!(f, "input"), + AttrTarget::InputVisibility => write!(f, "input visibility"), + } + } +} + +/// Helper macro for defining an attribute argument. +/// +/// Generates the implementations for [`AttrArg`], [`AttrArgValue`], and (optionally) [`Debug`]. +macro_rules! define_attribute { + // Generates the implementations for `AttrArg` and `AttrArgValue`, but not `Debug`. + ($name: literal => $ident: ident($ty: ty) for $target: expr, no_debug) => { + #[derive(Default)] + pub(crate) struct $ident(Option<$ty>); + + impl $crate::utils::AttrArg for $ident { + const NAME: &'static str = $name; + const TARGET: $crate::utils::AttrTarget = $target; + } + + impl $crate::utils::AttrArgValue for $ident { + type Value = $ty; + + fn new(value: Option) -> Self { + Self(value) + } + + fn get(&self) -> Option<&Self::Value> { + self.0.as_ref() + } + + fn set(&mut self, value: Option) { + self.0 = value; + } + } + }; + // Generates the implementations for `AttrArg`, `AttrArgValue`, and `Debug`. + ($name: literal => $ident: ident($ty: ty) for $target: expr $(,)?) => { + $crate::utils::define_attribute!($name => $ident($ty) for $target, no_debug); + + impl std::fmt::Debug for $ident { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match $crate::utils::AttrArgValue::get(self) { + None => Ok(()), + Some(value) => write!( + f, + "{} = {}", + ::NAME, + ::quote::ToTokens::to_token_stream(value) + ), + } + } + } + }; +} + +pub(crate) use define_attribute; diff --git a/bevy_proto_derive/src/utils/constants.rs b/bevy_proto_derive/src/utils/constants.rs new file mode 100644 index 0000000..6f32902 --- /dev/null +++ b/bevy_proto_derive/src/utils/constants.rs @@ -0,0 +1,38 @@ +//! Helper constants used in generated macro output. +//! +//! The purpose of these constants is so that we can easily make use +//! of them throughout modules without having to pass them around as +//! references (since these should never change). + +use proc_macro2::{Ident, Span, TokenStream}; +use quote::ToTokens; + +pub(crate) const SCHEMATIC_ATTR: &str = "schematic"; +pub(crate) const ASSET_SCHEMATIC_ATTR: &str = "asset_schematic"; + +pub(crate) const ASSET_ATTR: &str = "asset"; +pub(crate) const ENTITY_ATTR: &str = "entity"; +pub(crate) const INPUT_ATTR: &str = "input"; +pub(crate) const FROM_ATTR: &str = "from"; +pub(crate) const INTO_ATTR: &str = "into"; + +/// Ident for the `Schematic::Input` argument. +pub(crate) const INPUT_IDENT: ConstIdent = ConstIdent("__input__"); +/// Ident for the `SchematicId` argument. +pub(crate) const ID_IDENT: ConstIdent = ConstIdent("__id__"); +/// Ident for the `SchematicContext` and `AssetSchematicContext` argument. +pub(crate) const CONTEXT_IDENT: ConstIdent = ConstIdent("__context__"); +/// Ident for the `DependenciesBuilder` argument. +pub(crate) const DEPENDENCIES_IDENT: ConstIdent = ConstIdent("__context__"); +/// Ident used for temporary variables (to prevent accidental collisions). +pub(crate) const TEMP_IDENT: ConstIdent = ConstIdent("__temp__"); + +/// Helper struct used to generate a const-like [`Ident`] with the given name. +#[derive(Copy, Clone, PartialEq)] +pub(crate) struct ConstIdent(pub &'static str); + +impl ToTokens for ConstIdent { + fn to_tokens(&self, tokens: &mut TokenStream) { + Ident::new(self.0, Span::call_site()).to_tokens(tokens) + } +} diff --git a/bevy_proto_derive/src/utils/crates.rs b/bevy_proto_derive/src/utils/crates.rs new file mode 100644 index 0000000..787f5c7 --- /dev/null +++ b/bevy_proto_derive/src/utils/crates.rs @@ -0,0 +1,43 @@ +use proc_macro2::TokenStream; +use proc_macro_crate::{crate_name, Error, FoundCrate}; +use std::sync::OnceLock; + +static PROTO_CRATE: OnceLock = OnceLock::new(); +static BEVY_CRATE: OnceLock = OnceLock::new(); + +/// Returns a path to either the `bevy_proto_backend` crate or `bevy_proto::backend` module. +pub(crate) fn get_proto_crate() -> TokenStream { + PROTO_CRATE + .get_or_init(|| match crate_name("bevy_proto_backend") { + Ok(found_crate) => get_crate_path(found_crate), + Err(Error::CrateNotFound { .. }) => { + let path = + get_crate_path(crate_name("bevy_proto").expect( + "bevy_proto or bevy_proto_backend should be present in `Cargo.toml`", + )); + format!("{}::backend", path) + } + Err(error) => panic!("{}", error), + }) + .parse() + .expect("`get_proto_crate` should always return a valid `TokenStream`") +} + +/// Returns a path to the `bevy` crate. +pub(crate) fn get_bevy_crate() -> TokenStream { + BEVY_CRATE + .get_or_init(|| { + get_crate_path(crate_name("bevy").expect("bevy is present in `Cargo.toml`")) + }) + .parse() + .expect("`get_bevy_crate` should always return a valid `TokenStream`") +} + +fn get_crate_path(found_crate: FoundCrate) -> String { + match found_crate { + FoundCrate::Itself => String::from("crate"), + FoundCrate::Name(name) => { + format!("::{}", name) + } + } +} diff --git a/bevy_proto_derive/src/utils/exports.rs b/bevy_proto_derive/src/utils/exports.rs new file mode 100644 index 0000000..535b628 --- /dev/null +++ b/bevy_proto_derive/src/utils/exports.rs @@ -0,0 +1,42 @@ +//! Common type paths used in generated macro output. + +use crate::utils::{get_bevy_crate, get_proto_crate}; +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; + +/// Defines a path to a type for the given crate. +macro_rules! create_export { + (bevy :: $($segment: ident ::)* [$name: ident]) => { + create_export!(@export $($segment ::)* [$name] with get_bevy_crate); + }; + (bevy_proto :: $($segment: ident ::)* [$name: ident]) => { + create_export!(@export $($segment ::)* [$name] with get_proto_crate); + }; + (@export $($segment: ident ::)* [$name: ident] with $get_crate: ident) => { + pub(crate) struct $name; + impl ToTokens for $name { + fn to_tokens(&self, tokens: &mut TokenStream) { + let root = $get_crate(); + tokens.extend(quote!(#root :: $($segment ::)* $name)); + } + } + }; +} + +create_export!(bevy_proto::assets::[ProtoAsset]); +create_export!(bevy_proto::assets::[AssetSchematic]); +create_export!(bevy_proto::assets::[PreloadAssetSchematic]); +create_export!(bevy_proto::assets::[InlinableProtoAsset]); +create_export!(bevy_proto::assets::__private::[PreloadProtoAssetInput]); +create_export!(bevy_proto::deps::[DependenciesBuilder]); +create_export!(bevy_proto::schematics::[Schematic]); +create_export!(bevy_proto::schematics::[FromSchematicInput]); +create_export!(bevy_proto::schematics::[FromSchematicPreloadInput]); +create_export!(bevy_proto::schematics::[SchematicId]); +create_export!(bevy_proto::schematics::[SchematicContext]); +create_export!(bevy_proto::tree::[EntityAccess]); + +create_export!(bevy::reflect::[Reflect]); +create_export!(bevy::reflect::[FromReflect]); +create_export!(bevy::assets::[AssetServer]); +create_export!(bevy::utils::[Uuid]); diff --git a/bevy_proto_derive/src/utils/meta.rs b/bevy_proto_derive/src/utils/meta.rs new file mode 100644 index 0000000..4d75786 --- /dev/null +++ b/bevy_proto_derive/src/utils/meta.rs @@ -0,0 +1,69 @@ +use std::fmt::{Arguments, Formatter}; +use syn::meta::ParseNestedMeta; +use syn::{Error, LitBool, Token}; + +/// Parses an attribute as a `bool` value. +/// +/// This will return `true` if the attribute is empty (i.e. `#[foo]`), +/// otherwise it will parse the value as a `bool` (i.e. `#[foo = false]`). +pub(crate) fn parse_bool(meta: &ParseNestedMeta) -> Result { + Ok(!meta.input.peek(Token![=]) || meta.value()?.parse::()?.value()) +} + +/// Helper function for implementing [`Debug`] on attributes. +/// +/// The callback will write out whatever it's given while automatically +/// adding commas between each entry. +/// +/// This does not automatically add opening and closing parentheses. +pub(crate) fn debug_attribute( + f: &mut Formatter, + func: impl FnOnce(&mut dyn FnMut(Arguments) -> std::fmt::Result) -> std::fmt::Result, +) -> std::fmt::Result { + let mut needs_comma = false; + let mut write = |args: Arguments| -> std::fmt::Result { + if needs_comma { + write!(f, ", ")?; + } + + write!(f, "{}", args)?; + needs_comma = true; + + Ok(()) + }; + + func(&mut write) +} + +/// Returns an error for an unsupported attribute argument. +pub(crate) fn unsupported_arg(meta: &ParseNestedMeta, expected: Option<&[&str]>) -> Error { + if let Some(expected) = expected { + meta.error(format_args!( + "unsupported argument, expected one of: {:?}", + expected + )) + } else { + meta.error("unsupported argument") + } +} + +/// Helper macro for quickly parsing nested attributes and returning an error +/// if the attribute is not supported. +macro_rules! parse_nested_meta { + ($attr: ident, |$meta: ident| { $($arg: expr => $expr: expr $(,)?)+ }) => { + $attr.parse_nested_meta(|$meta| { + parse_nested_meta!(|$meta| { $($arg => $expr)+ }) + }) + }; + (|$meta: ident| { $($arg: expr => $expr: expr $(,)?)+ }) => {{ + $( + if $meta.path.is_ident($arg) { + return $expr; + } + )+ + + Err($crate::utils::unsupported_arg(&$meta, Some(&[ $($arg),+ ]))) + }}; +} + +pub(crate) use parse_nested_meta; diff --git a/bevy_proto_derive/src/utils/mod.rs b/bevy_proto_derive/src/utils/mod.rs new file mode 100644 index 0000000..3dff90b --- /dev/null +++ b/bevy_proto_derive/src/utils/mod.rs @@ -0,0 +1,11 @@ +pub(crate) use attr::*; +pub(crate) use crates::*; +pub(crate) use meta::*; +pub(crate) use next_id::*; + +mod attr; +pub(crate) mod constants; +mod crates; +pub(crate) mod exports; +mod meta; +mod next_id; diff --git a/bevy_proto_derive/src/utils/next_id.rs b/bevy_proto_derive/src/utils/next_id.rs new file mode 100644 index 0000000..70a2b08 --- /dev/null +++ b/bevy_proto_derive/src/utils/next_id.rs @@ -0,0 +1,24 @@ +use crate::utils::constants::ID_IDENT; +use crate::utils::exports::Uuid as BevyUuid; +use proc_macro2::TokenStream; +use quote::{quote, ToTokens}; +use uuid::Uuid; + +/// Generate a compile-time-constant ID for use in `SchematicId::next` calls. +pub(crate) struct NextId; + +impl ToTokens for NextId { + fn to_tokens(&self, tokens: &mut TokenStream) { + let uuid = Uuid::new_v4().as_u128(); + tokens.extend(quote!(#ID_IDENT.next(#uuid))); + } +} + +/// Generate a runtime-random ID for use in `SchematicId::next` calls. +pub(crate) struct RandomId; + +impl ToTokens for RandomId { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.extend(quote!(#ID_IDENT.next(#BevyUuid::new_v4()))); + } +} diff --git a/examples/bevy/asset_loading.rs b/examples/bevy/asset_loading.rs new file mode 100644 index 0000000..3731afe --- /dev/null +++ b/examples/bevy/asset_loading.rs @@ -0,0 +1,58 @@ +//! This example is a copy of Bevy's [`asset_loading`] example, but powered by the `bevy_proto` plugin. +//! +//! The most notable change is the use of _inlined assets_. +//! Rather than having to define our simple cube and sphere shapes in separate asset files, +//! we can define them directly in the prototype. +//! +//! Prototypes aren't a perfect replacement for Rust code— +//! especially if there's more advanced logic involved— +//! but they can be a great tool for rapid prototyping. +//! +//! [`asset_loading`]: https://github.com/bevyengine/bevy/blob/v0.11.2/examples/asset/asset_loading.rs + +use bevy::prelude::*; +use bevy_proto::prelude::*; + +fn main() { + App::new() + .add_plugins((DefaultPlugins, ProtoPlugin::default())) + .add_systems(Startup, load) + .add_systems( + Update, + ( + spawn_camera.run_if(prototype_ready("Camera").and_then(run_once())), + spawn_light.run_if(prototype_ready("Light").and_then(run_once())), + spawn_models + .run_if(prototypes_ready(["Sphere", "Cube", "Monkey"]).and_then(run_once())), + inspect, + ), + ) + .run(); +} + +fn load(mut prototypes: PrototypesMut) { + prototypes + .load_folder("examples/bevy/asset_loading") + .unwrap(); +} + +fn spawn_camera(mut commands: ProtoCommands) { + commands.spawn("Camera"); +} + +fn spawn_light(mut commands: ProtoCommands) { + commands.spawn("Light"); +} + +fn spawn_models(mut commands: ProtoCommands) { + commands.spawn("Sphere"); + commands.spawn("Cube"); + commands.spawn("Monkey"); +} + +// This relies on the `auto_name` feature to be useful +fn inspect(query: Query>) { + for name in &query { + println!("Spawned {:?}", name); + } +} diff --git a/examples/bevy/ui.rs b/examples/bevy/ui.rs index d6dbfac..421ff3d 100644 --- a/examples/bevy/ui.rs +++ b/examples/bevy/ui.rs @@ -77,7 +77,7 @@ fn mouse_scroll( impl Schematic for ScrollText { type Input = ScrollText; - fn apply(input: &Self::Input, context: &mut SchematicContext) { + fn apply(input: &Self::Input, _id: SchematicId, context: &mut SchematicContext) { let font = context .world() .resource::() @@ -95,7 +95,7 @@ impl Schematic for ScrollText { )); } - fn remove(_input: &Self::Input, context: &mut SchematicContext) { + fn remove(_input: &Self::Input, _id: SchematicId, context: &mut SchematicContext) { context.entity_mut().unwrap().remove::(); } } diff --git a/examples/custom_schematic.rs b/examples/custom_schematic.rs index 9094fdc..3f37c9f 100644 --- a/examples/custom_schematic.rs +++ b/examples/custom_schematic.rs @@ -54,8 +54,7 @@ impl Schematic for Foo { // Generally, this is `Self`. // However, we decided to use `FooInput`, so that can go here. type Input = FooInput; - - fn apply(input: &Self::Input, context: &mut SchematicContext) { + fn apply(input: &Self::Input, _id: SchematicId, context: &mut SchematicContext) { // 1. Create a camera if one doesn't exist in the world let world = context.world_mut(); let change_tick = world.change_tick(); @@ -81,7 +80,7 @@ impl Schematic for Foo { } } - fn remove(_input: &Self::Input, context: &mut SchematicContext) { + fn remove(_input: &Self::Input, _id: SchematicId, context: &mut SchematicContext) { // It's important we handle any necessary cleanup when removing a schematic. let world = context.world_mut(); let mut camera_query = world.query_filtered::>(); @@ -93,7 +92,11 @@ impl Schematic for Foo { context.entity_mut().unwrap().remove::(); } - fn preload_dependencies(input: &mut Self::Input, dependencies: &mut DependenciesBuilder) { + fn preload_dependencies( + input: &mut Self::Input, + _id: SchematicId, + dependencies: &mut DependenciesBuilder, + ) { // This method is optional, but it allows us to preload our assets. let _: Handle = dependencies.add_dependency(input.image.clone()); } diff --git a/examples/derive_schematic.rs b/examples/derive_schematic.rs index 0ae0785..b06ee79 100644 --- a/examples/derive_schematic.rs +++ b/examples/derive_schematic.rs @@ -76,7 +76,7 @@ struct EntityGroup(Vec); // This implementation allows us to get a group of entities from the world // that all share the name provided by `String`. impl FromSchematicInput for EntityGroup { - fn from_input(input: String, context: &mut SchematicContext) -> Self { + fn from_input(input: String, _id: SchematicId, context: &mut SchematicContext) -> Self { let world = context.world_mut(); let mut query = world.query::<(Entity, &Name)>(); let group = query @@ -119,12 +119,12 @@ impl From for Bar { // // ----------------------------------------------------------------------- // const _: () = { -// #[derive(::bevy::prelude::Reflect)] -// pub struct FooInput { -// lazy_asset: ::bevy_proto_backend::proto::ProtoAsset, -// preloaded_asset: ::bevy_proto_backend::proto::ProtoAsset, -// entity: ::bevy_proto_backend::tree::EntityAccess, -// optional_entity: ::bevy_proto_backend::tree::EntityAccess, +// #[derive(::bevy::reflect::Reflect)] +// struct FooInput { +// lazy_asset: bevy_proto_backend::assets::ProtoAsset, +// preloaded_asset: bevy_proto_backend::assets::ProtoAsset, +// entity: bevy_proto_backend::tree::EntityAccess, +// optional_entity: ::core::option::Option, // simple_from: [f32; 3], // complex_from: String, // #[reflect(ignore)] @@ -132,35 +132,57 @@ impl From for Bar { // #[reflect(ignore)] // __phantom_ty__: ::core::marker::PhantomData (T)>, // } -// impl ::bevy_proto_backend::schematics::FromSchematicInput> +// impl bevy_proto_backend::schematics::FromSchematicInput> // for Foo // { // fn from_input( // __input__: FooInput, -// __context__: &mut ::bevy_proto_backend::schematics::SchematicContext, +// __id__: bevy_proto_backend::schematics::SchematicId, +// __context__: &mut bevy_proto_backend::schematics::SchematicContext, // ) -> Self { // Self { -// lazy_asset: match __input__.lazy_asset { -// ::bevy_proto_backend::proto::ProtoAsset::AssetPath(ref path) => { __context__.world().resource::<::bevy::asset::AssetServer>().load(path) } -// ::bevy_proto_backend::proto::ProtoAsset::HandleId(handle_id) => { __context__.world().resource::<::bevy::asset::AssetServer>().get_handle(handle_id) } -// }, -// preloaded_asset: match __input__.preloaded_asset { -// ::bevy_proto_backend::proto::ProtoAsset::AssetPath(ref path) => { __context__.world().resource::<::bevy::asset::AssetServer>().load(path) } -// ::bevy_proto_backend::proto::ProtoAsset::HandleId(handle_id) => { __context__.world().resource::<::bevy::asset::AssetServer>().get_handle(handle_id) } -// }, -// entity: >::from_input(__input__.entity, __context__), -// optional_entity: as ::bevy_proto_backend::schematics::FromSchematicInput<::bevy_proto_backend::tree::EntityAccess>>::from_input(__input__.optional_entity, __context__), -// simple_from: >::from_input(__input__.simple_from, __context__), -// complex_from: >::from_input(__input__.complex_from, __context__), +// lazy_asset: bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __input__.lazy_asset, +// __id__.next(53117238229055557259509717840201618403u128), +// __context__, +// ), +// preloaded_asset: bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __input__.preloaded_asset, +// __id__.next(132456034052841687215576930551493772827u128), +// __context__, +// ), +// entity: bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __input__.entity, +// __id__.next(67591631779355904687644803370051695279u128), +// __context__, +// ), +// optional_entity: __input__.optional_entity.map(|__temp__| { +// bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __temp__, +// __id__.next(138904564953014408501596690788554691527u128), +// __context__, +// ) +// }), +// simple_from: bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __input__.simple_from, +// __id__.next(72007669688143100026735716730996138490u128), +// __context__, +// ), +// complex_from: bevy_proto_backend::schematics::FromSchematicInput::from_input( +// __input__.complex_from, +// __id__.next(17674188231867017750899388725992026672u128), +// __context__, +// ), // _phantom: __input__._phantom, // } // } // } -// impl ::bevy_proto_backend::schematics::Schematic for Foo { +// impl bevy_proto_backend::schematics::Schematic for Foo { // type Input = FooInput; // fn apply( // __input__: &Self::Input, -// __context__: &mut ::bevy_proto_backend::schematics::SchematicContext, +// __id__: bevy_proto_backend::schematics::SchematicId, +// __context__: &mut bevy_proto_backend::schematics::SchematicContext, // ) { // let __input__ = ::from_reflect( // &*::bevy::reflect::Reflect::clone_value(__input__), @@ -171,9 +193,13 @@ impl From for Bar { // std::any::type_name::() // ) // }); -// let __input__ = >::from_input(__input__, __context__); +// >>::from_input( +// __input__, +// __id__.next(289817135421861623180843918255160292199u128), +// __context__, +// ); // __context__ // .entity_mut() // .unwrap_or_else(|| { @@ -186,7 +212,8 @@ impl From for Bar { // } // fn remove( // __input__: &Self::Input, -// __context__: &mut ::bevy_proto_backend::schematics::SchematicContext, +// __id__: bevy_proto_backend::schematics::SchematicId, +// __context__: &mut bevy_proto_backend::schematics::SchematicContext, // ) { // __context__ // .entity_mut() @@ -200,20 +227,20 @@ impl From for Bar { // } // fn preload_dependencies( // __input__: &mut Self::Input, -// __dependencies__: &mut ::bevy_proto_backend::deps::DependenciesBuilder, +// __id__: bevy_proto_backend::schematics::SchematicId, +// __context__: &mut bevy_proto_backend::deps::DependenciesBuilder, // ) { -// match __input__.preloaded_asset { -// ::bevy_proto_backend::proto::ProtoAsset::AssetPath(ref path) => { -// let _: Handle = __dependencies__.add_dependency(path.to_owned()); -// } -// ::bevy_proto_backend::proto::ProtoAsset::HandleId(handle_id) => { -// panic!("expected `ProtoAsset::AssetPath` in field `{}` of `{}`, but found `ProtoAsset::HandleId`", "preloaded_asset", ::core::any::type_name::()); -// } -// } +// __input__.preloaded_asset = { +// let __temp__ = as ::bevy::reflect::FromReflect>::from_reflect(&*::bevy::reflect::Reflect::clone_value(&__input__.preloaded_asset)).unwrap_or_else(|| { panic!("{} should have a functioning `FromReflect` impl", ::std::any::type_name::()) }); +// bevy_proto_backend::assets::ProtoAsset::Handle( +// bevy_proto_backend::schematics::FromSchematicPreloadInput::from_preload_input( +// __temp__, +// __id__.next(258100584073326308005614300177082934377u128), +// __context__, +// ), +// ) +// }; // } // } -// const _: () = { -// mod Assertions {} -// }; // }; // ----------------------------------------------------------------------- diff --git a/src/conditions.rs b/src/conditions.rs index 91774eb..fa6b854 100644 --- a/src/conditions.rs +++ b/src/conditions.rs @@ -12,6 +12,17 @@ pub fn prototype_ready(id: I) -> impl Fn(Prototypes<'_>) -> bool { ProtoCondition::prototype_ready(id) } +/// Run condition that returns true if all the [prototypes] with the given +/// IDs are loaded and ready to be used. +/// +/// [prototypes]: Prototype +pub fn prototypes_ready(ids: I) -> impl Fn(Prototypes<'_>) -> bool +where + I::Item: ToString, +{ + ProtoCondition::prototypes_ready(ids) +} + /// A collection of common run conditions for use with custom [`Config`] types. pub struct ProtoCondition = ProtoConfig>(PhantomData); @@ -24,4 +35,19 @@ impl> ProtoCondition { let id = id.to_string(); move |prototypes: Prototypes| prototypes.is_ready(&id) } + + /// Run condition that returns true if all the [prototypes] with the given + /// IDs are loaded and ready to be used. + /// + /// [prototypes]: Prototype + pub fn prototypes_ready(ids: I) -> impl Fn(Prototypes<'_, C>) -> bool + where + I::Item: ToString, + { + let ids = ids + .into_iter() + .map(|id| id.to_string()) + .collect::>(); + move |prototypes: Prototypes| ids.iter().all(|id| prototypes.is_ready(&id.to_string())) + } } diff --git a/src/config.rs b/src/config.rs index aae65de..110a1f4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,7 @@ use bevy::prelude::Resource; use bevy_proto_backend::cycles::{Cycle, CycleResponse}; use bevy_proto_backend::proto::Config; -use bevy_proto_backend::schematics::{DynamicSchematic, SchematicContext}; +use bevy_proto_backend::schematics::{DynamicSchematic, SchematicContext, SchematicId}; use crate::hooks::{ OnAfterApplyPrototype, OnAfterApplySchematic, OnAfterRemovePrototype, OnAfterRemoveSchematic, @@ -158,40 +158,44 @@ impl Config for ProtoConfig { fn on_before_apply_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { if let Some(on_before_apply_schematic) = &mut self.on_before_apply_schematic { - on_before_apply_schematic(schematic, context); + on_before_apply_schematic(schematic, id, context); } } fn on_after_apply_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { if let Some(on_after_apply_schematic) = &mut self.on_after_apply_schematic { - on_after_apply_schematic(schematic, context); + on_after_apply_schematic(schematic, id, context); } } fn on_before_remove_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { if let Some(on_before_remove_schematic) = &mut self.on_before_remove_schematic { - on_before_remove_schematic(schematic, context); + on_before_remove_schematic(schematic, id, context); } } fn on_after_remove_schematic( &mut self, schematic: &DynamicSchematic, + id: SchematicId, context: &mut SchematicContext, ) { if let Some(on_after_remove_schematic) = &mut self.on_after_remove_schematic { - on_after_remove_schematic(schematic, context); + on_after_remove_schematic(schematic, id, context); } } diff --git a/src/custom.rs b/src/custom.rs index 2ac18e5..5314a2f 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -10,12 +10,13 @@ use bevy::asset::Handle; use bevy::prelude::{Component, GlobalTransform, Transform}; use bevy::reflect::{std_traits::ReflectDefault, Reflect}; use bevy::ui::widget::UiImageSize; +use bevy_proto_backend::assets::{AssetSchematic, InlinableProtoAsset}; use bevy_proto_backend::impls::bevy_impls; use bevy_proto_backend::proto::ProtoColor; use bevy_proto_backend::{from, from_to_default}; use bevy_proto_backend::schematics::{ - FromSchematicInput, ReflectSchematic, Schematic, SchematicContext, + FromSchematicInput, ReflectSchematic, Schematic, SchematicContext, SchematicId, }; pub(crate) fn register_custom_schematics(app: &mut App) { @@ -139,7 +140,7 @@ pub struct SpriteBundle { pub transform: Transform, #[reflect(default)] pub global_transform: GlobalTransform, - #[schematic(asset(lazy))] + #[schematic(asset)] pub texture: Handle, #[reflect(default)] pub visibility: bevy::render::view::Visibility, @@ -169,7 +170,7 @@ from!(bevy::sprite::SpriteBundle, SpriteBundle, |value: Input| { pub struct SpriteSheetBundle { #[reflect(default)] pub sprite: bevy_impls::sprite::TextureAtlasSpriteInput, - #[schematic(asset(lazy))] + #[schematic(asset(inline))] pub texture_atlas: Handle, #[reflect(default)] pub transform: Transform, @@ -415,7 +416,7 @@ from_to_default!( #[reflect(Schematic)] #[schematic(into = bevy::scene::DynamicSceneBundle)] pub struct DynamicSceneBundle { - #[schematic(asset(lazy))] + #[schematic(asset)] pub scene: Handle, #[reflect(default)] pub transform: Transform, @@ -448,7 +449,7 @@ from!( #[reflect(Schematic)] #[schematic(into = bevy::scene::SceneBundle)] pub struct SceneBundle { - #[schematic(asset(lazy))] + #[schematic(asset)] pub scene: Handle, #[reflect(default)] pub transform: Transform, @@ -497,16 +498,34 @@ pub struct Text2dBundle { #[cfg(feature = "bevy_text")] impl FromSchematicInput for bevy::text::Text2dBundle { - fn from_input(input: Text2dBundle, context: &mut SchematicContext) -> Self { + fn from_input(input: Text2dBundle, id: SchematicId, context: &mut SchematicContext) -> Self { Self { - text: FromSchematicInput::from_input(input.text, context), + text: FromSchematicInput::from_input( + input.text, + id.next(bevy::utils::Uuid::from_u128( + 0x14c512589e954232b77ee264aecebe56, + )), + context, + ), text_anchor: input.text_anchor, - text_2d_bounds: FromSchematicInput::from_input(input.text_2d_bounds, context), + text_2d_bounds: FromSchematicInput::from_input( + input.text_2d_bounds, + id.next(bevy::utils::Uuid::from_u128( + 0x73693c0f150b44389da54b25360886b2, + )), + context, + ), transform: input.transform, global_transform: input.global_transform, visibility: input.visibility, computed_visibility: input.computed_visibility, - text_layout_info: FromSchematicInput::from_input(input.text_layout_info, context), + text_layout_info: FromSchematicInput::from_input( + input.text_layout_info, + id.next(bevy::utils::Uuid::from_u128( + 0xa28731f3a3f445d69b85c438111c9949, + )), + context, + ), } } } @@ -549,7 +568,7 @@ pub struct ButtonBundle { #[cfg(feature = "bevy_ui")] impl FromSchematicInput for bevy::ui::node_bundles::ButtonBundle { - fn from_input(input: ButtonBundle, context: &mut SchematicContext) -> Self { + fn from_input(input: ButtonBundle, id: SchematicId, context: &mut SchematicContext) -> Self { Self { node: input.node, button: input.button, @@ -558,7 +577,13 @@ impl FromSchematicInput for bevy::ui::node_bundles::ButtonBundle { focus_policy: input.focus_policy, background_color: input.background_color.into(), border_color: input.border_color.into(), - image: bevy::ui::UiImage::from_input(input.image, context), + image: bevy::ui::UiImage::from_input( + input.image, + id.next(bevy::utils::Uuid::from_u128( + 0x1d002cb9c29f40cf97a71a341abe855f, + )), + context, + ), transform: input.transform, global_transform: input.global_transform, visibility: input.visibility, @@ -602,13 +627,19 @@ pub struct ImageBundle { #[cfg(feature = "bevy_ui")] impl FromSchematicInput for bevy::ui::node_bundles::ImageBundle { - fn from_input(input: ImageBundle, context: &mut SchematicContext) -> Self { + fn from_input(input: ImageBundle, id: SchematicId, context: &mut SchematicContext) -> Self { Self { node: input.node, style: input.style.into(), calculated_size: Default::default(), background_color: input.background_color.into(), - image: bevy::ui::UiImage::from_input(input.image, context), + image: bevy::ui::UiImage::from_input( + input.image, + id.next(bevy::utils::Uuid::from_u128( + 0x5f3dc1f3b56d49e99f2a5978aea6b745, + )), + context, + ), focus_policy: input.focus_policy, transform: input.transform, global_transform: input.global_transform, @@ -697,12 +728,30 @@ pub struct TextBundle { #[cfg(feature = "bevy_ui")] impl FromSchematicInput for bevy::ui::node_bundles::TextBundle { - fn from_input(input: TextBundle, context: &mut SchematicContext) -> Self { + fn from_input(input: TextBundle, id: SchematicId, context: &mut SchematicContext) -> Self { Self { node: input.node, - style: FromSchematicInput::from_input(input.style, context), - text: FromSchematicInput::from_input(input.text, context), - text_layout_info: FromSchematicInput::from_input(input.text_layout_info, context), + style: FromSchematicInput::from_input( + input.style, + id.next(bevy::utils::Uuid::from_u128( + 0x63ca849a99e44de2b6fcad4cbdd03640, + )), + context, + ), + text: FromSchematicInput::from_input( + input.text, + id.next(bevy::utils::Uuid::from_u128( + 0xd3a21a2a19ab4a18b8a60f5ab95f299d, + )), + context, + ), + text_layout_info: FromSchematicInput::from_input( + input.text_layout_info, + id.next(bevy::utils::Uuid::from_u128( + 0x3647343b704b40f2a789b890cf417c18, + )), + context, + ), text_flags: input.text_flags, calculated_size: input.calculated_size, focus_policy: input.focus_policy, @@ -711,7 +760,13 @@ impl FromSchematicInput for bevy::ui::node_bundles::TextBundle { visibility: input.visibility, computed_visibility: input.computed_visibility, z_index: input.z_index, - background_color: FromSchematicInput::from_input(input.background_color, context), + background_color: FromSchematicInput::from_input( + input.background_color, + id.next(bevy::utils::Uuid::from_u128( + 0xc82dc5faf3ff4442878496f8d77187c3, + )), + context, + ), } } } @@ -724,14 +779,15 @@ impl FromSchematicInput for bevy::ui::node_bundles::TextBundle { #[derive(Component, Schematic, Reflect)] #[reflect(Schematic)] #[schematic(into = bevy::pbr::MaterialMeshBundle)] -pub struct MaterialMeshBundle { - // #[reflect( - // default = "bevy_proto_backend::proto::ProtoAsset::default_handle_id::" - // )] - #[schematic(asset(lazy))] +pub struct MaterialMeshBundle +where + Handle: FromSchematicInput>, +{ + #[reflect(default)] + #[schematic(asset(inline))] pub mesh: Handle, - // #[reflect(default = "bevy_proto_backend::proto::ProtoAsset::default_handle_id::")] - #[schematic(asset(lazy))] + #[reflect(default)] + #[schematic(asset(inline))] pub material: Handle, #[reflect(default)] pub transform: Transform, @@ -744,7 +800,11 @@ pub struct MaterialMeshBundle { } #[cfg(feature = "bevy_pbr")] -impl From> for bevy::pbr::MaterialMeshBundle { +impl From> + for bevy::pbr::MaterialMeshBundle +where + Handle: FromSchematicInput>, +{ fn from(value: MaterialMeshBundle) -> Self { Self { mesh: value.mesh, @@ -765,10 +825,14 @@ impl From> for bevy::pbr::Material #[derive(Component, Schematic, Reflect)] #[reflect(Schematic)] #[schematic(into = bevy::sprite::MaterialMesh2dBundle)] -pub struct MaterialMesh2dBundle { +pub struct MaterialMesh2dBundle +where + Handle: FromSchematicInput>, +{ #[reflect(default)] pub mesh: bevy_impls::sprite::Mesh2dHandleInput, - #[schematic(asset(lazy))] + #[reflect(default)] + #[schematic(asset(inline))] pub material: Handle, #[reflect(default)] pub transform: Transform, @@ -781,12 +845,24 @@ pub struct MaterialMesh2dBundle { } #[cfg(feature = "bevy_sprite")] -impl FromSchematicInput> +impl FromSchematicInput> for bevy::sprite::MaterialMesh2dBundle +where + Handle: FromSchematicInput>, { - fn from_input(input: MaterialMesh2dBundle, context: &mut SchematicContext) -> Self { + fn from_input( + input: MaterialMesh2dBundle, + id: SchematicId, + context: &mut SchematicContext, + ) -> Self { Self { - mesh: bevy::sprite::Mesh2dHandle::from_input(input.mesh, context), + mesh: bevy::sprite::Mesh2dHandle::from_input( + input.mesh, + id.next(bevy::utils::Uuid::from_u128( + 0xc96384968f7f4143906ec8802addfac0, + )), + context, + ), material: input.material, transform: input.transform, global_transform: input.global_transform, diff --git a/src/hooks.rs b/src/hooks.rs index 45bc793..d7790ad 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -5,7 +5,7 @@ use bevy::asset::Handle; use bevy_proto_backend::cycles::{Cycle, CycleResponse}; -use bevy_proto_backend::schematics::{DynamicSchematic, SchematicContext}; +use bevy_proto_backend::schematics::{DynamicSchematic, SchematicContext, SchematicId}; use crate::proto::Prototype; @@ -17,11 +17,11 @@ pub type OnAfterApplyPrototype = Box; pub type OnAfterRemovePrototype = Box; pub type OnBeforeApplySchematic = - Box; + Box; pub type OnAfterApplySchematic = - Box; + Box; pub type OnBeforeRemoveSchematic = - Box; + Box; pub type OnAfterRemoveSchematic = - Box; + Box; pub type OnCycle = Box) -> CycleResponse + Send + Sync>; diff --git a/src/lib.rs b/src/lib.rs index 5391c77..c03601e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,9 +81,12 @@ mod schematics; /// ``` pub mod prelude { pub use crate::config::ProtoConfig; + pub use bevy_proto_backend::assets::{AssetSchematic, AssetSchematicAppExt}; pub use bevy_proto_backend::deps::DependenciesBuilder; pub use bevy_proto_backend::proto::Prototypical; - pub use bevy_proto_backend::schematics::{ReflectSchematic, Schematic, SchematicContext}; + pub use bevy_proto_backend::schematics::{ + ReflectSchematic, Schematic, SchematicContext, SchematicId, + }; pub use super::conditions::*; pub use super::plugin::ProtoPlugin; @@ -127,7 +130,7 @@ pub mod prelude { /// /// [prototype]: Prototype /// [`AssetEvent`]: bevy::asset::AssetEvent - pub type ProtoAssetEvent = bevy_proto_backend::proto::ProtoAssetEvent; + pub type ProtoAssetEvent = bevy_proto_backend::assets::ProtoAssetEvent; } /// Provides access to the [backend crate] that `bevy_proto` is built on. From e023489b1984accd8a1f64bc01f002dcffbd33d1 Mon Sep 17 00:00:00 2001 From: Gino Valente Date: Sat, 9 Sep 2023 14:40:29 -0700 Subject: [PATCH 2/6] Add sprite_sheet example --- Cargo.toml | 5 + .../bevy/sprite_sheet/Player.prototype.ron | 44 ++++++ .../textures/rpg/chars/gabe/gabe-idle-run.png | Bin 0 -> 1997 bytes assets/textures/rpg/release.txt | 23 ++++ .../src/impls/bevy_impls/sprite.rs | 126 +++++++++--------- examples/bevy/sprite_sheet.rs | 83 ++++++++++++ src/custom.rs | 40 +++--- 7 files changed, 239 insertions(+), 82 deletions(-) create mode 100644 assets/examples/bevy/sprite_sheet/Player.prototype.ron create mode 100644 assets/textures/rpg/chars/gabe/gabe-idle-run.png create mode 100644 assets/textures/rpg/release.txt create mode 100644 examples/bevy/sprite_sheet.rs diff --git a/Cargo.toml b/Cargo.toml index fec4534..148e8d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,6 +170,11 @@ name = "bevy_asset_loading" path = "examples/bevy/asset_loading.rs" required-features = ["ron", "auto_name", "custom_schematics"] +[[example]] +name = "bevy_sprite_sheet" +path = "examples/bevy/sprite_sheet.rs" +required-features = ["ron", "auto_name", "custom_schematics", "bevy_sprite"] + [[example]] name = "bevy_ui" path = "examples/bevy/ui.rs" diff --git a/assets/examples/bevy/sprite_sheet/Player.prototype.ron b/assets/examples/bevy/sprite_sheet/Player.prototype.ron new file mode 100644 index 0000000..5c27402 --- /dev/null +++ b/assets/examples/bevy/sprite_sheet/Player.prototype.ron @@ -0,0 +1,44 @@ +( + name: "Player", + schematics: { + "bevy_proto::custom::SpriteSheetBundle": ( + // The schematic for `TextureAtlas` defines an enum input with a `Grid` variant. + // The fields of this variant map to the parameters of `TextureAtlas::from_grid`. + texture_atlas: Asset(Grid( + texture: AssetPath("textures/rpg/chars/gabe/gabe-idle-run.png"), + tile_size: ( + x: 24.0, + y: 24.0 + ), + columns: 7, + rows: 1, + padding: None, + offset: None, + )), + sprite: ( + // Start our sprite at the first frame of the run animation + index: 1 + ), + transform: ( + scale: ( + x: 6.0, + y: 6.0, + z: 6.0, + ) + ), + ), + "bevy_sprite_sheet::AnimationIndices": ( + // The run animation actually starts on the second frame (index 1) + first: 1, + last: 6 + ), + "bevy_sprite_sheet::AnimationTimer": (( + duration: ( + secs: 0, + // 1e8 nanoseconds == 0.1 seconds + nanos: 100000000 + ), + mode: Repeating + )) + } +) \ No newline at end of file diff --git a/assets/textures/rpg/chars/gabe/gabe-idle-run.png b/assets/textures/rpg/chars/gabe/gabe-idle-run.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f57e34cf8c2a246e7027db5b106e0f76dbca52 GIT binary patch literal 1997 zcmV;;2Qv7HP)bC82?2V&uhX^!9$G(=}E{mm zj_>$}5xVaHx&?7~Og1}zczX1|;lK{xDnCEmr}LnpCp|qlWcFt=z@G?lcuYP#JqlSR z*pKaQfW~dX4FJe~;`hssqvN0x5Tt#V1q!Lz;PT_fzSL}hj*n*?-QdTjI03ZBz-!;m z2g?s&9E)uSr5D)^geI2nYyKi9P|H z9z>_?vv~5bS9ARN?AEglyN;$uCj@X`{P1uCc<09o9a)1?2LX2>Pxj3Sl9~;q2Zy*x zcZ(+vd-3_~R!wx!{`~SoucLOl!4C^Nf0hMmr2xHgCkI~boB8ld*qShf#N-t+`2#$? ziD9L+0{|#Ke~fT6hUCV3U-l{V0`L=eH~3+BSrewP(hQClz+M1W;_C70MAT=BKIT^v~Y_cOW zOA!3H;f0>#;hyDXO_(y}g?_B2dB*~ELq2ujW!(|9eU{Mua=&`MvhWh?rLP)7)`Tfv z;&PK{Ui(4v@5D=ba0u(AuUHeNctZCi04sqx7O30q!`tD4v`_zjrM06@W0&TJ?$sFrXe0A2*e&*AA&$cdNL*(4UfeDV~pI6Nj(p?DF1RqU2)Q2K0Yzud2qWaZ@P zO$^z}Z=Q=MNc$|RFJ3{;Mvw(iSo|9a)HDh9YFiv0lWAAW7C^0GRc1ipO2M*xN7YZ)-+!m)!+rvwc2 zjM}P<2b7@f`XfA;ndrEED`eLnVZYpukDC{`tk*o>2(U>|A&dYZ9d2Jq2E}E)hLzTi zngFkG)8)KE93GQt%oN%6M;PcCRe7PGO!?ZiP0C9+8pHYBvBtKZ7YfSHv$+VK%|#46 z+1|xdg@piOxE06@cEL$@90~iF)z_dWw;sjtQQj{-{n7qP3&nV*MYn)FWW8cFd z0H_Mf%pU;42&$=ZgMGFDI)!jFh8x@g0Fs;gsHVmt0`g(y4_C1to*soV`S$yJ{f$Ye zaG{PZtQ2M^@Xv=`WN?kOa@4>-56l%0X4T2 z1_1~p{>wTM9(@EzVc9{qOD!Z6q6d0L5ijkjMMOaUt)|9-yJOOxJ$8t2G=|CodEOQ; z(E-rG2*3;Cw;)WJu20;;N~M%Io+4$B(|xyq!Ve2d`enU_O#XoDCNiGeLh+6~mn@=& zOu4T35gf1eg34S1$;~}-&^iGC9KQPr#k(I#A(t;~t|mA@_E93SgrhO8DH0%LSrw`3tK{CEzH3U& z1|WpI#Zf)WLlu@0kjiZnM>f8-*?HuuI_?l#I*XY zU_}rumZjxw^_&Fq)`Tpu`@sWB79oOJHn8hprE54r93GQ3uNHMT8&b1@>Wf#%r9$tIU9kvShQ7`9oSAs;wG`jb6Z5!xh){qj>n5_GgMRKi04S5 zvuk*9vFLjFK;zbIFk!?+o5q8g35b3J2DGA8#Kz8wJiHi$s}!l(3@OgPwcRCUyIDk2 zL`rcoq+2eky+HGdOS$Vci^Hp3Ly~QL`+610bl!OGgxomgpnXcwI#I>KGZt1{YG2eCBR>QM7IzCai#n6-&1$KL7-R)-56(_5(P~pP&enCLHX_)7g zsT1gW2dxuIqN~liW^mfztR@5PWH5fb@zgp|yE27Yl6^zzasVGEdYFxo<%K>Oa^l5R zfl_7t3i7-xuBiCUuD@MIY@wJ1x3s*?rD7JOi?$O?{V@JK6^xg4wwTk3z-y;wuTwjd zBHpFtZAhN1Y0+Lw-() - .register_asset_schematic::(); + .register_asset_schematic::() + .register_type::>(); } impl_external_schematic! { @@ -144,11 +144,29 @@ impl_external_asset_schematic! { /// The schematic input type for [`TextureAtlas`]. #[derive(Reflect)] -pub struct TextureAtlasInput { - pub texture: ProtoAsset, - pub size: Vec2, - pub textures: Vec, - pub texture_handles: Option, usize>>, +pub enum TextureAtlasInput { + Grid { + #[reflect(default)] + texture: ProtoAsset, + #[reflect(default)] + tile_size: Vec2, + #[reflect(default = "default_rows")] + columns: usize, + #[reflect(default = "default_columns")] + rows: usize, + #[reflect(default)] + padding: Option, + #[reflect(default)] + offset: Option, + }, +} + +fn default_rows() -> usize { + 1 +} + +fn default_columns() -> usize { + 1 } impl FromSchematicInput for TextureAtlas { @@ -157,33 +175,25 @@ impl FromSchematicInput for TextureAtlas { id: SchematicId, context: &mut SchematicContext, ) -> Self { - Self { - texture: FromSchematicInput::from_input( - input.texture, - id.next(bevy::utils::Uuid::from_u128( - 0x9d0bb563b0fe45d689404b63567c597b, - )), - context, - ), - size: input.size, - textures: input.textures, - texture_handles: input.texture_handles.map(|value| { - value - .into_iter() - .map(|(key, value)| { - ( - FromSchematicInput::from_input( - key, - id.next(bevy::utils::Uuid::from_u128( - 0xccb7edfefe6e4a92ab42c7c7e87e3afa, - )), - context, - ), - value, - ) - }) - .collect() - }), + match input { + TextureAtlasInput::Grid { + texture, + tile_size, + columns, + rows, + padding, + offset, + } => { + let texture = FromSchematicInput::from_input( + texture, + id.next(bevy::utils::Uuid::from_u128( + 0x9d0bb563b0fe45d689404b63567c597b, + )), + context, + ); + + Self::from_grid(texture, tile_size, columns, rows, padding, offset) + } } } } @@ -194,33 +204,25 @@ impl FromSchematicPreloadInput for TextureAtlas { id: SchematicId, dependencies: &mut DependenciesBuilder, ) -> Self { - Self { - texture: FromSchematicPreloadInput::from_preload_input( - input.texture, - id.next(bevy::utils::Uuid::from_u128( - 0x9d0bb563b0fe45d689404b63567c597b, - )), - dependencies, - ), - size: input.size, - textures: input.textures, - texture_handles: input.texture_handles.map(|value| { - value - .into_iter() - .map(|(key, value)| { - ( - FromSchematicPreloadInput::from_preload_input( - key, - id.next(bevy::utils::Uuid::from_u128( - 0xccb7edfefe6e4a92ab42c7c7e87e3afa, - )), - dependencies, - ), - value, - ) - }) - .collect() - }), + match input { + TextureAtlasInput::Grid { + texture, + tile_size, + columns, + rows, + padding, + offset, + } => { + let texture = FromSchematicPreloadInput::from_preload_input( + texture, + id.next(bevy::utils::Uuid::from_u128( + 0x9d0bb563b0fe45d689404b63567c597b, + )), + dependencies, + ); + + Self::from_grid(texture, tile_size, columns, rows, padding, offset) + } } } } diff --git a/examples/bevy/sprite_sheet.rs b/examples/bevy/sprite_sheet.rs new file mode 100644 index 0000000..ac022f1 --- /dev/null +++ b/examples/bevy/sprite_sheet.rs @@ -0,0 +1,83 @@ +//! This example is a copy of Bevy's [`sprite_sheet`] example, but powered by the `bevy_proto` plugin. +//! +//! The most notable change is the use of _inlined assets_. +//! Rather than having to define our sprite sheet's [`TextureAtlas`] programmatically, +//! we can define it directly in the prototype. +//! +//! Prototypes aren't a perfect replacement for Rust code— +//! especially if there's more advanced logic involved— +//! but they can be a great tool for rapid prototyping. +//! +//! [`sprite_sheet`]: https://github.com/bevyengine/bevy/blob/v0.11.2/examples/2d/sprite_sheet.rs + +use bevy::prelude::*; +use bevy_proto::prelude::*; + +fn main() { + App::new() + .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) // prevents blurry sprites + .add_plugins(ProtoPlugin::new()) + .register_type::() + .register_type::() + .register_type::() // Needs to be registered for `Timer` to be deserializable + .add_systems(Startup, (setup, load)) + .add_systems( + Update, + ( + spawn.run_if(prototype_ready("Player").and_then(run_once())), + animate_sprite, + inspect, + ), + ) + .run(); +} + +#[derive(Component, Reflect, Schematic)] +#[reflect(Schematic)] +struct AnimationIndices { + first: usize, + last: usize, +} + +#[derive(Component, Deref, DerefMut, Reflect, Schematic)] +#[reflect(Schematic)] +struct AnimationTimer(Timer); + +fn animate_sprite( + time: Res