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
This commit is contained in:
Mark Moissette 2023-09-29 12:59:07 +02:00 committed by GitHub
parent 4d09d17614
commit 0cd7d5d53b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 27 deletions

14
Cargo.lock generated
View File

@ -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",

View File

@ -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" }

View File

@ -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"] }

View File

@ -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`:

View File

@ -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<SpawnedRootProcessed>>,
without_children: Query<Entity, (With<SpawnedRootProcessed>, Without<Children>)>,// if there are not children left, bevy removes Children ?

View File

@ -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"

View File

@ -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`: