Skip to content

Commit

Permalink
Improved assets UI
Browse files Browse the repository at this point in the history
Also integrated draco compression level into export_a_model function.
  • Loading branch information
SapwoodStudio committed Mar 23, 2024
1 parent aa1caac commit 5cf1154
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions Converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,7 @@ def export_a_model(item_name, item_dir, textures_temp_dir, export_settings_dict,
# Turn on Draco compression if auto-optimizing files and exporting a GLB.
if draco_compression and export_settings_dict["extension"] == ".glb":
options["export_draco_mesh_compression_enable"] = True
options["export_draco_mesh_compression_level"] = compression_level

# Get export operator.
operator = export_settings_dict["operator"]
Expand Down
27 changes: 14 additions & 13 deletions UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,25 +452,33 @@ def draw_settings_assets(self, context):
row.label(text="Assets", icon='ASSET_MANAGER')
if settings.advanced_ui:
row.prop(settings, 'asset_extract_previews', text='', icon='IMAGE_PLANE')
if settings.mark_as_assets:
row.prop(settings, 'assets_allow_duplicates', text='', icon='DUPLICATE')
row.prop(settings, 'asset_add_metadata', text='', icon='COLOR')
row.prop(settings, 'mark_as_assets', text='', icon='ASSET_MANAGER')

if settings.mark_as_assets:
box_mark_assets = box_assets.box()
row = box_mark_assets.row(align=False)
row.label(text='Mark Assets', icon='ASSET_MANAGER')

if settings.advanced_ui:
import_formats = [i.format for i in bpy.context.scene.transmogrifier_imports]
if "Collections" in settings.asset_types_to_mark and "BLEND" in import_formats:
row.prop(settings, 'mark_only_master_collection', text='', icon='GROUP')
row.prop(settings, 'assets_allow_duplicates', text='', icon='DUPLICATE')
grid = box_mark_assets.grid_flow(columns=6, align=True)
grid.prop(settings, 'asset_types_to_mark')

if settings.advanced_ui:
if settings.mark_as_assets:
row.prop(settings, 'asset_add_metadata', text='', icon='COLOR')
if settings.advanced_ui:
if "Objects" in settings.asset_types_to_mark:
box_objects = box_mark_assets.box()
col = box_objects.column(align=True)
col.label(text="Object Types", icon='OBJECT_DATA')
grid = box_objects.grid_flow(columns=5, align=True)
grid.prop(settings, 'asset_object_types_filter', text='')

if settings.asset_add_metadata:
box_metadata = box_mark_assets.box()
box_metadata = box_assets.box()
col = box_metadata.column(align=True)
col.label(text='Metadata', icon='COLOR')
col = box_metadata.column(align=True)
Expand All @@ -483,19 +491,12 @@ def draw_settings_assets(self, context):

box_assets.use_property_split = False
if settings.assets_allow_duplicates:
box_duplicates = box_mark_assets.box()
box_duplicates = box_assets.box()
col = box_duplicates.column(align=True)
col.label(text='Allow Duplicates', icon='DUPLICATE')
grid = box_duplicates.grid_flow(columns=6, align=True)
grid.prop(settings, 'assets_allow_duplicates_filter')

if "Objects" in settings.asset_types_to_mark:
box_objects = box_mark_assets.box()
col = box_objects.column(align=True)
col.label(text="Object Types", icon='OBJECT_DATA')
grid = box_objects.grid_flow(columns=5, align=True)
grid.prop(settings, 'asset_object_types_filter', text='')

if settings.mark_as_assets:
box_assets.use_property_split = True
box_library = box_assets.box()
Expand Down

0 comments on commit 5cf1154

Please sign in to comment.