mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-26 21:37:01 +00:00
Compare commits
6 Commits
2e87921fef
...
a3d95b8425
Author | SHA1 | Date | |
---|---|---|---|
|
a3d95b8425 | ||
|
1f959c51bd | ||
|
37dd6a990c | ||
|
bb4b07b7af | ||
|
f438116ece | ||
|
ada54450a5 |
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bevy_gltf_blueprints"
|
||||
version = "0.10.0"
|
||||
version = "0.10.2"
|
||||
authors = ["Mark 'kaosat-dev' Moissette"]
|
||||
description = "Adds the ability to define Blueprints/Prefabs for Bevy inside gltf files and spawn them in Bevy."
|
||||
homepage = "https://github.com/kaosat-dev/Blender_bevy_components_workflow"
|
||||
|
@ -224,7 +224,7 @@ Typically , the order of systems should be
|
||||
|
||||
***bevy_gltf_components (GltfComponentsSet::Injection)*** => ***bevy_gltf_blueprints (GltfBlueprintsSet::Spawn, GltfBlueprintsSet::AfterSpawn)*** => ***replace_proxies***
|
||||
|
||||
see https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic for how to set it up correctly
|
||||
see an example [here](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic) for how to set it up correctly
|
||||
|
||||
|
||||
|
||||
@ -278,9 +278,9 @@ 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
|
||||
see [here](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 [here](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation/src/game/in_game.rs)
|
||||
|
||||
|
||||
## Materials
|
||||
@ -301,7 +301,7 @@ material_library_folder: "materials".into() //defaults to "materials" the folder
|
||||
```bevy_gltf_blueprints``` currently does NOT take care of loading those at runtime
|
||||
|
||||
|
||||
see https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/materials for how to set it up correctly
|
||||
see an example [here](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/materials) for how to set it up correctly
|
||||
|
||||
Generating optimised blueprints and material libraries can be automated using the latests version of the [Blender plugin](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/tools/gltf_auto_export)
|
||||
|
||||
@ -326,15 +326,15 @@ As it create custom properties that are writen in real **ron** file format inste
|
||||
|
||||
## Examples
|
||||
|
||||
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic
|
||||
* [basic](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic)
|
||||
|
||||
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic_xpbd_physics
|
||||
* [xbpd](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/basic_xpbd_physics)
|
||||
|
||||
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation
|
||||
* [animation](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/animation)
|
||||
|
||||
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/materials
|
||||
* [materials](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/materials)
|
||||
|
||||
https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles
|
||||
* [multiple_levels_multiple_blendfiles](https://github.com/kaosat-dev/Blender_bevy_components_workflow/tree/main/examples/bevy_gltf_blueprints/multiple_levels_multiple_blendfiles)
|
||||
|
||||
|
||||
## Compatible Bevy versions
|
||||
|
@ -19,7 +19,11 @@ pub use copy_components::*;
|
||||
use core::fmt;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use bevy::{prelude::*, render::primitives::Aabb, utils::HashMap};
|
||||
use bevy::{
|
||||
prelude::*,
|
||||
render::{primitives::Aabb, view::VisibilitySystems},
|
||||
utils::HashMap,
|
||||
};
|
||||
use bevy_gltf_components::{ComponentsFromGltfPlugin, GltfComponentsSet};
|
||||
|
||||
#[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone)]
|
||||
@ -170,10 +174,11 @@ impl Plugin for BlueprintsPlugin {
|
||||
.in_set(GltfBlueprintsSet::Spawn),
|
||||
)
|
||||
.add_systems(
|
||||
Update,
|
||||
PostUpdate,
|
||||
(spawned_blueprint_post_process, apply_deferred)
|
||||
.chain()
|
||||
.in_set(GltfBlueprintsSet::AfterSpawn),
|
||||
.in_set(GltfBlueprintsSet::AfterSpawn)
|
||||
.before(VisibilitySystems::CheckVisibility),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
import os
|
||||
import bpy
|
||||
|
||||
from .get_standard_exporter_settings import get_standard_exporter_settings
|
||||
from .preferences import (AutoExportGltfPreferenceNames)
|
||||
|
||||
def generate_gltf_export_preferences(addon_prefs):
|
||||
@ -37,10 +39,31 @@ def generate_gltf_export_preferences(addon_prefs):
|
||||
export_optimize_animation_size=False
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
for key in addon_prefs.__annotations__.keys():
|
||||
if str(key) not in AutoExportGltfPreferenceNames:
|
||||
#print("overriding setting", key, "value", getattr(addon_prefs,key))
|
||||
gltf_export_preferences[key] = getattr(addon_prefs,key)
|
||||
gltf_export_preferences[key] = getattr(addon_prefs, key)
|
||||
|
||||
|
||||
"""standard_gltf_exporter_settings = get_standard_exporter_settings()
|
||||
print("standard settings", standard_gltf_exporter_settings)
|
||||
|
||||
constant_keys = [
|
||||
'export_cameras',
|
||||
'export_extras', # For custom exported properties.
|
||||
'export_lights',
|
||||
]
|
||||
|
||||
# a certain number of essential params should NEVER be overwritten , no matter the settings of the standard exporter
|
||||
for key in standard_gltf_exporter_settings.keys():
|
||||
if str(key) not in constant_keys:
|
||||
gltf_export_preferences[key] = standard_gltf_exporter_settings.get(key)
|
||||
|
||||
print("final export preferences", gltf_export_preferences)"""
|
||||
|
||||
|
||||
return gltf_export_preferences
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
import bpy
|
||||
|
||||
def get_standard_exporter_settings():
|
||||
settings_key = 'glTF2ExportSettings'
|
||||
for scene in bpy.data.scenes:
|
||||
if 'glTF2ExportSettings' in scene:
|
||||
print("standard exporter settings", scene['glTF2ExportSettings'])
|
||||
if settings_key in scene:
|
||||
settings = scene[settings_key]
|
||||
#print("standard exporter settings", settings, dict(settings))
|
||||
return dict(settings)
|
@ -208,9 +208,6 @@ def get_scenes(addon_prefs):
|
||||
|
||||
return [level_scene_names, level_scenes, library_scene_names, library_scenes]
|
||||
|
||||
|
||||
|
||||
|
||||
def inject_blueprints_list_into_main_scene(scene):
|
||||
print("injecting assets/blueprints data into scene")
|
||||
root_collection = scene.collection
|
||||
|
Loading…
Reference in New Issue
Block a user