Compare commits

..

1 Commits

Author SHA1 Message Date
Mark Moissette
d3641af48a
Merge b3c87085de into 9b50d77790 2024-07-24 22:10:18 +00:00
7 changed files with 23 additions and 23 deletions

View File

@ -226,7 +226,7 @@ Blender side:
- [ ] materials_path custom property should be ignored both in the list of fixable component AND on export - [ ] materials_path custom property should be ignored both in the list of fixable component AND on export
- [ ] if we want to add material_infos & others as normal components they should not be editable, so we need another attribute, and adapt the UI for that - [ ] if we want to add material_infos & others as normal components they should not be editable, so we need another attribute, and adapt the UI for that
- [ ] if material library is toggled, then changes to materials should not change the blueprints that are using them => not really: as the name & co might change - [ ] if material library is toggled, then changes to materials should not change the blueprints that are using them ?
- [ ] material assets seem to be added to list regardless of whether material exports are enabled or not - [ ] material assets seem to be added to list regardless of whether material exports are enabled or not
- [ ] review & upgrade overall logic of material libraries, their names & output path - [ ] review & upgrade overall logic of material libraries, their names & output path
- [ ] persist exported materials path in blueprints so that it can be read from library file users - [ ] persist exported materials path in blueprints so that it can be read from library file users
@ -253,7 +253,6 @@ Blender side:
- [x] rename all "main scene xx" to "level scene" - [x] rename all "main scene xx" to "level scene"
- [x] make sure the "add scene" button is not available unless you have actually selected one - [x] make sure the "add scene" button is not available unless you have actually selected one
- [x] make auto export be on by default, however bail out early by detecting if there are any level/blueprint scenes - [x] make auto export be on by default, however bail out early by detecting if there are any level/blueprint scenes
- [x] remove custom components to filter out correctly from exported blueprints list
Bevy Side: Bevy Side:
- [x] deprecate BlueprintName & BlueprintPath & use BlueprintInfo instead - [x] deprecate BlueprintName & BlueprintPath & use BlueprintInfo instead

View File

@ -3,7 +3,16 @@ import bpy
from blenvy.core.object_makers import (make_empty) from blenvy.core.object_makers import (make_empty)
from blenvy.add_ons.bevy_components.utils import is_component_valid_and_enabled from blenvy.add_ons.bevy_components.utils import is_component_valid_and_enabled
from ..constants import custom_properties_to_filter_out from ..constants import custom_properties_to_filter_out
from ..utils import remove_unwanted_custom_properties
def remove_unwanted_custom_properties(object):
to_remove = []
component_names = list(object.keys()) # to avoid 'IDPropertyGroup changed size during iteration' issues
for component_name in component_names:
if not is_component_valid_and_enabled(object, component_name):
to_remove.append(component_name)
for cp in custom_properties_to_filter_out + to_remove:
if cp in object:
del object[cp]
# TODO: rename actions ? # TODO: rename actions ?
# reference https://github.com/KhronosGroup/glTF-Blender-IO/blob/main/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py#L481 # reference https://github.com/KhronosGroup/glTF-Blender-IO/blob/main/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py#L481

View File

@ -6,9 +6,6 @@ from .duplicate_object import duplicate_object
from .export_gltf import export_gltf from .export_gltf import export_gltf
from blenvy.core.scene_helpers import add_scene_property from blenvy.core.scene_helpers import add_scene_property
from ..constants import custom_properties_to_filter_out from ..constants import custom_properties_to_filter_out
from ..utils import remove_unwanted_custom_properties
""" """
generates a temporary scene, fills it with data, cleans up after itself generates a temporary scene, fills it with data, cleans up after itself
* named using temp_scene_name * named using temp_scene_name
@ -30,9 +27,6 @@ def generate_temporary_scene_and_export(settings, gltf_export_settings, gltf_out
print("entry in additional data", entry, "value", additional_data[entry], "in", additional_data.name) print("entry in additional data", entry, "value", additional_data[entry], "in", additional_data.name)
temp_scene[entry] = additional_data[entry] temp_scene[entry] = additional_data[entry]
# we remove everything from the black list
remove_unwanted_custom_properties(temp_scene)
# save active scene # save active scene
active_scene = bpy.context.window.scene active_scene = bpy.context.window.scene
# and selected collection # and selected collection

View File

@ -7,5 +7,5 @@ custom_properties_to_filter_out = [
'components_meta', 'Components_meta', 'components_meta', 'Components_meta',
'_combine', 'template', '_combine', 'template',
'Blenvy_scene_type', 'blenvy_scene_type', 'Blenvy_scene_type', 'blenvy_scene_type',
'materials_path', 'export_path', 'Materials_path', 'Export_path'
] ]

View File

@ -58,7 +58,10 @@ def draw_settings_ui(layout, auto_export_settings):
# materials # materials
section.prop(auto_export_settings, "export_materials_library") section.prop(auto_export_settings, "export_materials_library")
section = section.box()
section.enabled = controls_enabled and auto_export_settings.export_materials_library
#section.prop(auto_export_settings, "materials_path")

View File

@ -2,18 +2,6 @@ import posixpath
import bpy import bpy
from pathlib import Path from pathlib import Path
from blenvy.assets.assets_scan import get_blueprint_asset_tree, get_level_scene_assets_tree2 from blenvy.assets.assets_scan import get_blueprint_asset_tree, get_level_scene_assets_tree2
from blenvy.add_ons.bevy_components.utils import is_component_valid_and_enabled
from .constants import custom_properties_to_filter_out
def remove_unwanted_custom_properties(object):
to_remove = []
component_names = list(object.keys()) # to avoid 'IDPropertyGroup changed size during iteration' issues
for component_name in component_names:
if not is_component_valid_and_enabled(object, component_name):
to_remove.append(component_name)
for cp in custom_properties_to_filter_out + to_remove:
if cp in object:
del object[cp]
def assets_to_fake_ron(list_like): def assets_to_fake_ron(list_like):
result = [] result = []

View File

@ -183,6 +183,13 @@ class BlenvyManager(PropertyGroup):
print("setting", setting, settings[setting]) print("setting", setting, settings[setting])
setattr(self, setting, settings[setting]) setattr(self, setting, settings[setting])
except:pass except:pass
"""if "mode" in settings:
self.mode = settings["mode"]
asset_path_names = ['project_root_path', 'assets_path', 'blueprints_path', 'levels_path', 'materials_path']
for asset_path_name in asset_path_names:
if asset_path_name in settings:
setattr(self, asset_path_name, settings[asset_path_name])"""
self.settings_save_enabled = True self.settings_save_enabled = True