mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 11:50:53 +00:00
refactor(Blender): export_scene_settings => match_blender_visuals
* also updated name & description for more clarity
This commit is contained in:
parent
8f854e1b61
commit
f27c8a078c
@ -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")
|
||||
export_scene_settings = getattr(settings.auto_export, "export_scene_settings")
|
||||
match_blender_visuals = getattr(settings.auto_export, "match_blender_visuals")
|
||||
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 export_scene_settings:
|
||||
if match_blender_visuals:
|
||||
# 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 export_scene_settings:
|
||||
if match_blender_visuals:
|
||||
# inject/ update scene components
|
||||
remove_scene_components(settings.level_scenes)
|
||||
|
||||
|
@ -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
|
||||
'export_scene_settings',
|
||||
'match_blender_visuals',
|
||||
'export_blueprints',
|
||||
'export_separate_dynamic_and_static_objects',
|
||||
'split_out_materials',
|
||||
|
@ -45,12 +45,10 @@ class AutoExportSettings(PropertyGroup):
|
||||
update=save_settings
|
||||
) # type: ignore
|
||||
|
||||
# scenes
|
||||
|
||||
# scene components
|
||||
export_scene_settings: BoolProperty(
|
||||
name='Export scene settings',
|
||||
description='Export scene settings ie AmbientLighting, Bloom, AO etc',
|
||||
# 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',
|
||||
default=False,
|
||||
update=save_settings
|
||||
) # type: ignore
|
||||
|
@ -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, "export_scene_settings")
|
||||
section.prop(auto_export_settings, "match_blender_visuals")
|
||||
|
||||
header, panel = layout.panel("Change Detection", default_closed=False)
|
||||
header.label(text="Change Detection")
|
||||
|
@ -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.export_scene_settings = True
|
||||
blenvy.auto_export.match_blender_visuals = True
|
||||
blenvy.auto_export.export_blueprints = True
|
||||
blenvy.auto_export.split_out_materials = True
|
||||
|
||||
|
@ -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.export_scene_settings = True
|
||||
blenvy.auto_export.match_blender_visuals = True
|
||||
blenvy.auto_export.export_blueprints = True
|
||||
#blenvy.auto_export.split_out_materials = True
|
||||
|
||||
|
@ -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.export_scene_settings = True
|
||||
blenvy.auto_export.match_blender_visuals = True
|
||||
blenvy.auto_export.export_blueprints = True
|
||||
blenvy.auto_export.split_out_materials = True
|
||||
|
||||
|
@ -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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=True,
|
||||
export_blueprints=True,
|
||||
split_out_materials=False
|
||||
)
|
||||
|
@ -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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=True,
|
||||
export_blueprints=True,
|
||||
)
|
||||
assert os.path.exists(os.path.join(setup_data["levels_path"], "World.glb")) == True
|
||||
|
@ -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",
|
||||
export_scene_settings=True,
|
||||
match_blender_visuals=True,
|
||||
export_blueprints=True,
|
||||
split_out_materials=False
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user