Compare commits

..

1 Commits

Author SHA1 Message Date
Mark Moissette
178fe548f9
Merge 013087eebe into 9b50d77790 2024-08-11 23:57:46 +00:00
11 changed files with 29 additions and 28 deletions

View File

@ -65,10 +65,9 @@ impl Plugin for BlenvyPlugin {
fn build(&self, app: &mut App) {
app.add_plugins((
ComponentsFromGltfPlugin::default(),
#[cfg(debug_assertions)] // we only need the export registry plugin at dev time
#[cfg(not(target_arch = "wasm32"))]
ExportRegistryPlugin::default(),
BlueprintsPlugin::default(),
#[cfg(not(target_arch = "wasm32"))] // save & load is only for non wasm platforms
SaveLoadPlugin::default()
))
.insert_resource(BlenvyConfig {

View File

@ -26,7 +26,7 @@ def auto_export(changes_per_scene, changes_per_collection, changes_per_material,
try:
#should we use change detection or not
change_detection = getattr(settings.auto_export, "change_detection")
match_blender_visuals = getattr(settings.auto_export, "match_blender_visuals")
export_scene_settings = getattr(settings.auto_export, "export_scene_settings")
export_blueprints_enabled = getattr(settings.auto_export, "export_blueprints")
split_out_materials = getattr(settings.auto_export, "split_out_materials")
split_out_animations = getattr(settings.auto_export, "split_out_animations")
@ -54,7 +54,7 @@ def auto_export(changes_per_scene, changes_per_collection, changes_per_material,
bpy.context.window_manager.blueprints_registry.add_blueprint(blueprint)
#bpy.context.window_manager.blueprints_registry.refresh_blueprints()
if match_blender_visuals:
if export_scene_settings:
# inject/ update scene components
upsert_scene_components(settings.level_scenes)
#inject/ update light shadow information
@ -153,7 +153,7 @@ def auto_export(changes_per_scene, changes_per_collection, changes_per_material,
finally:
# FIXME: error handling ? also redundant
if match_blender_visuals:
if export_scene_settings:
# inject/ update scene components
remove_scene_components(settings.level_scenes)

View File

@ -15,7 +15,7 @@ parameter_names_whitelist_common = [
# which auto export settings changes should trigger a re-export
parameter_names_whitelist_auto_export = [
# auto export
'match_blender_visuals',
'export_scene_settings',
'export_blueprints',
'export_separate_dynamic_and_static_objects',
'split_out_materials',

View File

@ -45,10 +45,12 @@ class AutoExportSettings(PropertyGroup):
update=save_settings
) # type: ignore
# matching visuals between Blender & Bevy
match_blender_visuals: BoolProperty(
name='Match Blender visuals in Bevy',
description='Adds a number of components for AmbientLighting, Bloom, AO to try and match the look & feel of visuals from Blender in Bevy',
# scenes
# scene components
export_scene_settings: BoolProperty(
name='Export scene settings',
description='Export scene settings ie AmbientLighting, Bloom, AO etc',
default=False,
update=save_settings
) # type: ignore

View File

@ -23,7 +23,7 @@ def draw_settings_ui(layout, auto_export_settings):
op.filepath="____dummy____"
op.gltf_export_id = "blenvy" # we specify that we are in a special case
section.prop(auto_export_settings, "match_blender_visuals")
section.prop(auto_export_settings, "export_scene_settings")
header, panel = layout.panel("Change Detection", default_closed=False)
header.label(text="Change Detection")

View File

@ -104,7 +104,7 @@ def test_export_complex(setup_data):
#blenvy.project_root_path =
#blenvy.blueprints_path
blenvy.auto_export.auto_export = True
blenvy.auto_export.match_blender_visuals = True
blenvy.auto_export.export_scene_settings = True
blenvy.auto_export.export_blueprints = True
blenvy.auto_export.split_out_materials = True

View File

@ -51,7 +51,7 @@ def test_export_external_blueprints(setup_data):
#blenvy.project_root_path =
#blenvy.blueprints_path
blenvy.auto_export.auto_export = True
blenvy.auto_export.match_blender_visuals = True
blenvy.auto_export.export_scene_settings = True
blenvy.auto_export.export_blueprints = True
#blenvy.auto_export.split_out_materials = True

View File

@ -105,7 +105,7 @@ def test_export_complex(setup_data):
#blenvy.project_root_path =
#blenvy.blueprints_path
blenvy.auto_export.auto_export = True
blenvy.auto_export.match_blender_visuals = True
blenvy.auto_export.export_scene_settings = True
blenvy.auto_export.export_blueprints = True
blenvy.auto_export.split_out_materials = True

View File

@ -142,7 +142,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=True
)
@ -161,7 +161,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=True
)
@ -186,7 +186,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=True
)
@ -202,7 +202,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=True
)
@ -231,7 +231,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=False
)
@ -247,7 +247,7 @@ def test_export_changed_parameters(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=False
)

View File

@ -82,7 +82,7 @@ def test_export_do_not_export_blueprints(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="assets/models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=False,
)
assert os.path.exists(os.path.join(setup_data["models_path"], "World.glb")) == True
@ -109,7 +109,7 @@ def test_export_custom_blueprints_path(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
blueprints_path = "assets/other_blueprints"
)
@ -135,7 +135,7 @@ def test_export_materials_library(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials = True
)
@ -162,7 +162,7 @@ def test_export_materials_library_custom_path(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials = True,
materials_path="assets/other_materials"
@ -221,7 +221,7 @@ def test_export_do_not_export_marked_assets(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
)
assert os.path.exists(os.path.join(setup_data["levels_path"], "World.glb")) == True
@ -254,7 +254,7 @@ def test_export_separate_dynamic_and_static_objects(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
export_separate_dynamic_and_static_objects = True
)
@ -282,7 +282,7 @@ def test_export_should_not_generate_orphan_data(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
)
assert os.path.exists(os.path.join(setup_data["levels_path"], "World.glb")) == True

View File

@ -31,7 +31,7 @@ def run_auto_export(setup_data):
direct_mode=True,
project_root_path = os.path.abspath(setup_data["root_path"]),
export_output_folder="./models",
match_blender_visuals=True,
export_scene_settings=True,
export_blueprints=True,
split_out_materials=False
)