Compare commits

..

No commits in common. "5d7f633750e6e9fc8bc69ed5fc7ae44907d2afc8" and "68eac8d3208a39605d14d673f2931e25d0f2343c" have entirely different histories.

12 changed files with 52 additions and 49 deletions

View File

@ -1,8 +1,8 @@
[package]
name = "bevy_gltf_blueprints"
version = "0.10.0"
version = "0.9.0"
authors = ["Mark 'kaosat-dev' Moissette"]
description = "Adds the ability to define Blueprints/Prefabs for Bevy inside gltf files and spawn them in Bevy."
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"
repository = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
keywords = ["gamedev", "bevy", "gltf", "blueprint", "prefab"]

View File

@ -5,7 +5,7 @@
# bevy_gltf_blueprints
Built on [bevy_gltf_components](https://crates.io/crates/bevy_gltf_components) this crate adds the ability to define Blueprints/Prefabs for [Bevy](https://bevyengine.org/) inside gltf files and spawn them in Bevy.
Built upon [bevy_gltf_components](https://crates.io/crates/bevy_gltf_components) this crate adds the ability to define Blueprints/Prefabs for [Bevy](https://bevyengine.org/) inside gltf files and spawn them in Bevy.
* Allows you to create lightweight levels, where all assets are different gltf files and loaded after the main level is loaded
* Allows you to spawn different entities from gtlf files at runtime in a clean manner, including simplified animation support !
@ -15,9 +15,7 @@ A blueprint is a set of **overrideable** components + a hierarchy: ie
* just a Gltf file with Gltf_extras specifying components
* a component called BlueprintName
Particularly useful when using [Blender](https://www.blender.org/) as an editor for the [Bevy](https://bevyengine.org/) game engine, combined with the Blender add-ons that do a lot of the work for you
- [gltf_auto_export](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/tools/gltf_auto_export)
- [bevy_components](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/tools/bevy_components)
Particularly useful when using [Blender](https://www.blender.org/) as an editor for the [Bevy](https://bevyengine.org/) game engine, combined with the [Blender plugin](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/tools/gltf_auto_export) that does a lot of the work for you
## Usage
@ -28,7 +26,7 @@ Here's a minimal usage example:
# Cargo.toml
[dependencies]
bevy="0.13"
bevy_gltf_blueprints = { version = "0.10"}
bevy_gltf_blueprints = { version = "0.9"}
```
@ -66,7 +64,7 @@ fn spawn_blueprint(
Add the following to your `[dependencies]` section in `Cargo.toml`:
```toml
bevy_gltf_blueprints = "0.10"
bevy_gltf_blueprints = "0.9"
```
Or use `cargo add`:
@ -167,10 +165,13 @@ commands.spawn((
### BluePrintBundle
There is also a ```BluePrintBundle``` for convenience , which just has
There is also a bundle for convenience , which just has
* a ```BlueprintName``` component
* a ```SpawnHere``` component
[```BluePrintBundle```](./src/lib.rs#22)
## Additional information
- When a blueprint is spawned, all its children entities (and nested children etc) also have an ```InBlueprint``` component that gets insert
@ -218,7 +219,7 @@ the ordering of systems is very important !
For example to replace your proxy components (stand-in components when you cannot/ do not want to use real components in the gltf file) with actual ones, which should happen **AFTER** the Blueprint based spawning,
so ```bevy_gltf_blueprints``` provides a **SystemSet** for that purpose: ```GltfBlueprintsSet```
so ```bevy_gltf_blueprints``` provides a **SystemSet** for that purpose:[```GltfBlueprintsSet```](./src/lib.rs#16)
Typically , the order of systems should be
@ -280,7 +281,8 @@ pub fn animation_change_on_proximity_foxes(
see https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation for how to set it up correctly
particularly from https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation/game/in_game.rs
particularly from https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation/game/in_game.rs#86
onward
## Materials
@ -344,7 +346,7 @@ The main branch is compatible with the latest Bevy release, while the branch `be
Compatibility of `bevy_gltf_blueprints` versions:
| `bevy_gltf_blueprints` | `bevy` |
| :-- | :-- |
| `0.9 - 0.10` | `0.13` |
| `0.9` | `0.13` |
| `0.3 - 0.8` | `0.12` |
| `0.1 - 0.2` | `0.11` |
| branch `main` | `0.13` |

View File

@ -150,7 +150,7 @@ pub(crate) fn prepare_blueprints(
commands.entity(entity).insert(BlueprintAssetsLoaded);
}
} else {
// in case there are no blueprintsList, we revert back to the old behaviour
// in case there are no blueprintsList
commands.entity(entity).insert(BlueprintAssetsLoaded);
}
}
@ -243,14 +243,11 @@ pub(crate) fn spawn_from_blueprints(
let model_path = Path::new(&library_path).join(Path::new(model_file_name.as_str()));
// info!("attempting to spawn {:?}", model_path);
let model_handle: Handle<Gltf> = asset_server.load(model_path.clone()); // FIXME: kinda weird now
let model_handle: Handle<Gltf> = asset_server.load(model_path); // FIXME: kinda weird now
let gltf = assets_gltf.get(&model_handle).unwrap_or_else(|| {
panic!(
"gltf file {:?} should have been loaded",
model_path.to_str()
)
});
let gltf = assets_gltf
.get(&model_handle)
.expect("this gltf should have been loaded");
// WARNING we work under the assumtion that there is ONLY ONE named scene, and that the first one is the right one
let main_scene_name = gltf

View File

@ -1,8 +1,8 @@
[package]
name = "bevy_gltf_components"
version = "0.5.1"
version = "0.5.0"
authors = ["Mark 'kaosat-dev' Moissette"]
description = "Allows you to define Bevy components direclty inside gltf files and instanciate the components on the Bevy side."
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"
repository = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
keywords = ["gamedev", "bevy", "assets", "gltf", "components"]

View File

@ -13,9 +13,9 @@ This crate allows you to define [Bevy](https://bevyengine.org/) components direc
***important*** : the plugin for processing gltf files runs in ***update*** , so you cannot use the components directly if you spawn your scene from gltf in ***setup*** (the additional components will not show up)
Please see the
* [example](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_components/basic)
* or use [```bevy_asset_loader```](https://github.com/NiklasEi/bevy_asset_loader) for reliable preloading of files, as this crate does not deal with loading your assets.
* alternatively, use the [```bevy_gltf_blueprints```](https://crates.io/crates/bevy_gltf_blueprints) crate, built on this crate's features,
* [example](https://github.com/kaosat-dev/Blender_bevy_components_workflow/examples/basic)
* or use [```bevy_asset_loader```](https://github.com/NiklasEi/bevy_asset_loader) for a reliable workflow.
* alternatively, use the [```bevy_gltf_blueprints```](https://github.com/kaosat-dev/Blender_bevy_components_workflow/blob/main/crates/bevy_gltf_blueprints) crate, build on this crate's features,
that allows you to directly spawn entities from gltf based blueprints.
Here's a minimal usage example:
@ -29,7 +29,7 @@ bevy_gltf_components = { version = "0.5"}
```
```rust no_run
//too barebones of an example to be meaningfull, please see https://github.com/kaosat-dev/Blender_bevy_components_workflow/bevy_gltf_components/examples/basic for a real example
//too barebones of an example to be meaningfull, please see https://github.com/kaosat-dev/Blender_bevy_components_workflow/examples/basic for a real example
fn main() {
App::new()
.add_plugins(DefaultPlugins)
@ -84,7 +84,7 @@ Or disable the legacy mode: (enabled by default)
ComponentsFromGltfPlugin{legacy_mode: false}
```
You **need** to disable legacy mode if you want to use the [```bevy_components```](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/tools/bevy_components) Blender addon + the [```bevy_registry_export crate```](https://crates.io/crates/bevy_registry_export) !
You **need** to disable legacy mode if you want to use the [```bevy_components```](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/tools_bevy_blueprints/tools/bevy_components) Blender addon + the [```bevy_registry_export crate```](https://crates.io/crates/bevy_registry_export) !
As it create custom properties that are writen in real **ron** file format
instead of a simplified version (the one in the legacy mode)
@ -98,7 +98,7 @@ For example to replace your proxy components (stand-in components when you canno
which should happen **AFTER** the components from the gltf files have been injected,
so ```bevy_gltf_components``` provides a **SystemSet** for that purpose:```GltfComponentsSet```
so ```bevy_gltf_components``` provides a **SystemSet** for that purpose:[```GltfComponentsSet```](./src/lib.rs#46)
Typically , the order of systems should be
@ -116,7 +116,7 @@ Typically , the order of systems should be
## Examples
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_components/basic
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/basic

View File

@ -1,6 +1,6 @@
[package]
name = "bevy_gltf_save_load"
version = "0.4.1"
version = "0.4.0"
authors = ["Mark 'kaosat-dev' Moissette"]
description = "Save & load your bevy games"
homepage = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
@ -15,7 +15,8 @@ workspace = true
[dependencies]
bevy = { version = "0.13", default-features = false, features = ["bevy_asset", "bevy_scene", "bevy_gltf"] }
bevy_gltf_blueprints = { version = "0.10", path = "../bevy_gltf_blueprints" }
#bevy_gltf_blueprints = "0.9"
bevy_gltf_blueprints = { version = "0.9", path = "../bevy_gltf_blueprints" }
[dev-dependencies]
bevy = { version = "0.13", default-features = false, features = ["dynamic_linking"] }

View File

@ -36,7 +36,7 @@ Here's a minimal usage example:
[dependencies]
bevy="0.13"
bevy_gltf_save_load = "0.4"
bevy_gltf_blueprints = "0.10" // also needed
bevy_gltf_blueprints = "0.9" // also needed
```
```rust no_run
@ -133,7 +133,7 @@ pub fn setup_game(
```
take a look at the [example](https://github.com/kaosat-dev/Blender_bevy_components_workflow/blob/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs) for more clarity
take a look at the [example]('https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs) for more clarity
## Installation
@ -142,7 +142,12 @@ Add the following to your `[dependencies]` section in `Cargo.toml`:
```toml
bevy_gltf_save_load = "0.3"
bevy_gltf_blueprints = "0.10" // also needed, as bevy_gltf_save_load does not re-export it at this time
<<<<<<< HEAD
bevy_gltf_blueprints = "0.8" // also needed, as bevy_gltf_save_load does not re-export it at this time
=======
bevy_gltf_blueprints = "0.6" // also needed, as bevy_gltf_save_load does not re-export it at this time
>>>>>>> 9cb9dda5d35c635d367fa81ca1a6c752cda9bc02
```
Or use `cargo add`:
@ -263,7 +268,7 @@ pub fn request_load(
- ```LoadingFinished``` for loading
> Note: I **highly** recomend you change states when you start/finish saving & loading, otherwise things **will** get unpredictable
Please see [the example](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs) for this.
Please see [the example]('https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs#77') for this.
## Additional notes
@ -282,8 +287,8 @@ For convenience ```bevy_gltf_save_load``` provides two **SystemSets**
Highly advised to get a better understanding of how things work !
To get started I recomend looking at
- [world setup](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/in_game.rs)
- [various events & co](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs)
- [world setup]('https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/in_game.rs#13')
- [various events & co]('https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_save_load/basic/src/game/mod.rs#77')
All examples are here:

View File

@ -1,11 +1,11 @@
[package]
name = "bevy_registry_export"
version = "0.3.1"
version = "0.3.0"
authors = ["Mark 'kaosat-dev' Moissette", "Pascal 'Killercup' Hertleif"]
description = "Allows you to create a Json export of all your components/ registered types of your Bevy app/game"
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"
repository = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
keywords = ["gamedev", "bevy", "assets", "registry", "components"]
keywords = ["gamedev", "bevy", "assets", "gltf", "components"]
categories = ["game-development"]
edition = "2021"
license = "MIT OR Apache-2.0"

View File

@ -36,7 +36,7 @@ fn main() {
```
take a look at the [example](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_registry_export/basic/src/core/mod.rs) for more clarity
take a look at the [example]('https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_registry_export/basic/src/core/mod.rs) for more clarity
## Installation

View File

@ -15,7 +15,6 @@ expected_custom_property_values = {'AComponentWithAnExtremlyExageratedOrMaybeNot
'0.0, low_frequency_boost_curvature: 0.0, prefilter_settings: (threshold: 0.0, threshold_softness: '
'0.0))',
'BlueprintName': '(" ")',
'BlueprintsList': '("")',
'BorderColor': '(Rgba(red:1.0, green:1.0, blue:0.0, alpha:1.0))',
'Button': '()',
'CalculatedClip': '(clip: (max: Vec2(x:0.0, y:0.0), min: Vec2(x:0.0, y:0.0)))',
@ -215,7 +214,6 @@ expected_custom_property_values_randomized = {'AComponentWithAnExtremlyExagerate
'0.8133212327957153, prefilter_settings: (threshold: 0.8235888481140137, threshold_softness: '
'0.6534725427627563))',
'BlueprintName': '("sbnpsago")',
'BlueprintsList': '("")',
'BorderColor': '(Rgba(red:0.5714026093482971, green:0.42888906598091125, blue:0.5780913233757019, '
'alpha:0.20609822869300842))',
'Button': '()',

View File

@ -48,12 +48,12 @@ def test_components_should_generate_correct_custom_properties(setup_data):
except Exception as error:
errors.append(error)
pp = pprint.PrettyPrinter(depth=14, width=120)
'''pp = pprint.PrettyPrinter(depth=14, width=120)
print("CUSTOM PROPERTY VALUES")
pp.pprint(custom_property_values)
pp.pprint(custom_property_values)'''
assert len(errors) == 0
assert len(added_components) == 159
assert len(added_components) == 158
def test_components_should_generate_correct_custom_properties_with_randomized_values(setup_data):
@ -105,7 +105,7 @@ def test_components_should_generate_correct_custom_properties_with_randomized_va
print("error_components", error_components)
assert len(errors) == 0
assert len(added_components) == 159
assert len(added_components) == 158
def test_components_should_generate_correct_propertyGroup_values_from_custom_properties(setup_data):
registry = bpy.context.window_manager.components_registry
@ -163,7 +163,7 @@ def test_components_should_generate_correct_propertyGroup_values_from_custom_pro
for index, error in enumerate(errors):
print("ERROR", error, failing_components[index])
assert len(errors) == 0
assert len(added_components) == 159
assert len(added_components) == 158
def test_remove_components(setup_data):

View File

@ -1,7 +1,7 @@
bl_info = {
"name": "gltf_auto_export",
"author": "kaosigh",
"version": (0, 16, 0),
"version": (0, 15, 0),
"blender": (3, 4, 0),
"location": "File > Import-Export",
"description": "glTF/glb auto-export",