From 0cd7d5d53b2675fbd60a1be58630e6eacd8abf11 Mon Sep 17 00:00:00 2001 From: Mark Moissette Date: Fri, 29 Sep 2023 12:59:07 +0200 Subject: [PATCH] chore(): minor tweaks (#8) * relaxed bevy version requirements to work with all v0.11.xx versions & the dependency between blueprints & components crate * bevy_gltf_blueprints: added a more clear warning message for the random timing/ no children in scene issue * docs(crates): modified the install instruction to be patch version agnostic --- Cargo.lock | 14 +++++++------- Cargo.toml | 4 ++-- crates/bevy_gltf_blueprints/Cargo.toml | 8 ++++---- crates/bevy_gltf_blueprints/README.md | 6 +++--- .../bevy_gltf_blueprints/src/spawn_post_process.rs | 9 +++++---- crates/bevy_gltf_components/Cargo.toml | 8 ++++---- crates/bevy_gltf_components/README.md | 6 +++--- 7 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64661bd..a5ad8a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -721,15 +721,17 @@ dependencies = [ [[package]] name = "bevy_gltf_blueprints" -version = "0.1.1" +version = "0.1.2" dependencies = [ "bevy", - "bevy_gltf_components 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bevy_gltf_components 0.1.2", ] [[package]] name = "bevy_gltf_components" -version = "0.1.1" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e39a0250b75ec5cfbe5b56f0348da8b08da433ec4e31ebb1cae6ae5fe4d26ae" dependencies = [ "bevy", "ron", @@ -738,9 +740,7 @@ dependencies = [ [[package]] name = "bevy_gltf_components" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680276f556c9caf53a32ec0604f9aa4ae336c506bec40d34f6daa33f32a22f13" +version = "0.1.3" dependencies = [ "bevy", "ron", @@ -755,7 +755,7 @@ dependencies = [ "bevy_asset_loader", "bevy_editor_pls", "bevy_gltf_blueprints", - "bevy_gltf_components 0.1.1", + "bevy_gltf_components 0.1.3", "bevy_rapier3d", "rand", "ron", diff --git a/Cargo.toml b/Cargo.toml index 5730e77..3b9cc2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,14 +12,14 @@ members = [ [dev-dependencies] -bevy="0.11.2" +bevy="0.11" bevy_rapier3d = { version = "0.22.0", features = [ "serde-serialize", "debug-render-3d", "enhanced-determinism"] } bevy_editor_pls = { git="https://github.com/jakobhellermann/bevy_editor_pls.git" } bevy_asset_loader = { version = "0.17.0", features = ["standard_dynamic_assets" ]} #version = "0.16", rand = "0.8.5" [dependencies] -bevy = { version = "0.11.2", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } +bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } bevy_gltf_components = { path = "crates/bevy_gltf_components" } bevy_gltf_blueprints = { path = "crates/bevy_gltf_blueprints" } diff --git a/crates/bevy_gltf_blueprints/Cargo.toml b/crates/bevy_gltf_blueprints/Cargo.toml index 60fedb9..b0aae83 100644 --- a/crates/bevy_gltf_blueprints/Cargo.toml +++ b/crates/bevy_gltf_blueprints/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_gltf_blueprints" -version = "0.1.1" +version = "0.1.2" authors = ["Mark 'kaosat-dev' Moissette"] description = "Adds the ability to define Blueprints/Prefabs for [Bevy](https://bevyengine.org/) inside gltf files and spawn them in Bevy." homepage = "https://github.com/kaosat-dev/Blender_bevy_components_workflow" @@ -11,8 +11,8 @@ edition = "2021" license = "MIT OR Apache-2.0" [dev-dependencies] -bevy="0.11.2" +bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf", "bevy_animation"] } [dependencies] -bevy_gltf_components = "0.1.1" -bevy = { version = "0.11.2", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf", "bevy_animation"] } +bevy_gltf_components = "0.1" +bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf", "bevy_animation"] } diff --git a/crates/bevy_gltf_blueprints/README.md b/crates/bevy_gltf_blueprints/README.md index 4a5cea7..a66dc25 100644 --- a/crates/bevy_gltf_blueprints/README.md +++ b/crates/bevy_gltf_blueprints/README.md @@ -22,8 +22,8 @@ Here's a minimal usage example: ```toml # Cargo.toml [dependencies] -bevy="0.11.2" -bevy_gltf_blueprints = { version = "0.1.1"} +bevy="0.11" +bevy_gltf_blueprints = { version = "0.1"} ``` @@ -61,7 +61,7 @@ fn spawn_blueprint( Add the following to your `[dependencies]` section in `Cargo.toml`: ```toml -bevy_gltf_blueprints = "0.1.1" +bevy_gltf_blueprints = "0.1" ``` Or use `cargo add`: diff --git a/crates/bevy_gltf_blueprints/src/spawn_post_process.rs b/crates/bevy_gltf_blueprints/src/spawn_post_process.rs index 2c49d34..3534e75 100644 --- a/crates/bevy_gltf_blueprints/src/spawn_post_process.rs +++ b/crates/bevy_gltf_blueprints/src/spawn_post_process.rs @@ -21,7 +21,7 @@ pub(crate) struct SpawnedRootProcessed; /// this system updates the first (and normally only) child of a scene flaged SpawnedRoot /// - adds a name based on parent component (spawned scene) which is named on the scene name/prefab to be instanciated /// - adds the initial physics impulse (FIXME: we would need to add a temporary physics component to those who do not have it) -// FIXME: updating hierarchy does not work in all cases ! this is sadly dependant on the structure of the exported blend data, disablin for now +// FIXME: updating hierarchy does not work in all cases ! this is sadly dependant on the structure of the exported blend data // - blender root-> object with properties => WORKS // - scene instance -> does not work // it might be due to how we add components to the PARENT item in gltf to components @@ -57,12 +57,14 @@ pub(crate) fn update_spawned_root_first_child( */ for (scene_instance, children, name, parent, original) in unprocessed_entities.iter() { - println!("children of scene {:?}", children); + // if children.len() == 0 { + warn!("timing issue ! no children found, please restart your bevy app (bug being investigated)"); + // println!("children of scene {:?}", children); continue; } // the root node is the first & normally only child inside a scene, it is the one that has all relevant components - let root_entity = children.first().unwrap(); //FIXME: and what about childless ones ?? + let root_entity = children.first().unwrap(); //FIXME: and what about childless ones ?? => should not be possible normally // let root_entity_data = all_children.get(*root_entity).unwrap(); // fixme : randomization should be controlled via parameters, perhaps even the seed could be specified ? @@ -117,7 +119,6 @@ pub(crate) fn update_spawned_root_first_child( } /// cleans up dynamically spawned scenes so that they get despawned if they have no more children -// FIXME: this can run too early , and since withouth_children matches not yet completed scene instances, boom, it removes components/children before they can be used pub(crate) fn cleanup_scene_instances( scene_instances: Query<(Entity, &Children), With>, without_children: Query, Without)>,// if there are not children left, bevy removes Children ? diff --git a/crates/bevy_gltf_components/Cargo.toml b/crates/bevy_gltf_components/Cargo.toml index f97ca5f..037db67 100644 --- a/crates/bevy_gltf_components/Cargo.toml +++ b/crates/bevy_gltf_components/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_gltf_components" -version = "0.1.1" +version = "0.1.3" authors = ["Mark 'kaosat-dev' Moissette"] description = "Allows you to define [Bevy](https://bevyengine.org/) components direclty inside gltf files and instanciate the components on the Bevy side." homepage = "https://github.com/kaosat-dev/Blender_bevy_components_workflow" @@ -11,9 +11,9 @@ edition = "2021" license = "MIT OR Apache-2.0" [dev-dependencies] -bevy="0.11.2" +bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } [dependencies] -bevy = { version = "0.11.2", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } +bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] } serde = "1.0.188" -ron="0.8.1" +ron = "0.8.1" diff --git a/crates/bevy_gltf_components/README.md b/crates/bevy_gltf_components/README.md index a54249f..55d8dcf 100644 --- a/crates/bevy_gltf_components/README.md +++ b/crates/bevy_gltf_components/README.md @@ -23,8 +23,8 @@ Here's a minimal usage example: ```toml # Cargo.toml [dependencies] -bevy="0.11.2" -bevy_gltf_components = { version = "0.1.1"} +bevy="0.11" +bevy_gltf_components = { version = "0.1"} ``` @@ -60,7 +60,7 @@ bevy_gltf_components = { version = "0.1.1"} Add the following to your `[dependencies]` section in `Cargo.toml`: ```toml -bevy_gltf_components = "0.1.1" +bevy_gltf_components = "0.1" ``` Or use `cargo add`: