Skip to content

Commit

Permalink
Improved Asset Quality menu
Browse files Browse the repository at this point in the history
Renamed quality gradient from Highest-Medium-Low to more intuitively descriptive options.
  • Loading branch information
SapwoodStudio committed Apr 6, 2024
1 parent 887fed5 commit 5de8807
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,7 @@ def apply_textures_custom(item_dir, item_name, import_file, textures_dir, textur
clean_data_block(bpy.data.materials)
clean_data_block(bpy.data.images)

if (mark_as_assets and asset_quality != "Highest") or not mark_as_assets:
if (mark_as_assets and asset_quality != "Highest Fidelity") or not mark_as_assets:
if conversion_count == 0:
# Create a temporary textures directory beside the custom textures directory.
create_textures_temp(Path(textures_custom_dir), Path(textures_custom_dir), textures_temp_dir)
Expand Down Expand Up @@ -2510,14 +2510,14 @@ def apply_textures_custom(item_dir, item_name, import_file, textures_dir, textur
assign_materials(item_name)

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Medium")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Balanced")

# Copy original custom textures to item_name directory if elected.
if copy_textures_custom_dir:
copy_textures_from_custom_source(textures_custom_dir, item_dir, textures_dir)


elif mark_as_assets and asset_quality == "Highest":
elif mark_as_assets and asset_quality == "Highest Fidelity":
# Create a temporary textures directory beside the custom textures directory.
create_textures_temp(Path(textures_custom_dir), Path(textures_custom_dir), textures_temp_dir)

Expand All @@ -2543,13 +2543,13 @@ def apply_textures_custom(item_dir, item_name, import_file, textures_dir, textur
assign_materials(item_name)

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest Fidelity")

# Modify textures if requested.
modify_textures()

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Medium")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Balanced")

# Copy original custom textures to item_name directory if elected.
if copy_textures_custom_dir:
Expand Down Expand Up @@ -2621,13 +2621,13 @@ def apply_textures_packed(item_dir, item_name, import_file, textures_dir, textur
reimport_textures_to_existing_materials(textures_temp_dir, mapped_textures)

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest Fidelity")

# Modify textures if requested.
modify_textures()

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Medium")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Balanced")

print("Applied packed textures to objects")
logging.info("Applied packed textures to objects")
Expand Down Expand Up @@ -2681,13 +2681,13 @@ def apply_textures_external(item_dir, item_name, import_file, textures_dir, text
assign_materials(item_name)

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Highest Fidelity")

# Modify textures if requested.
modify_textures()

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Medium")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Balanced")

print("Applied external textures to objects")
logging.info("Applied external textures to objects")
Expand Down Expand Up @@ -3744,7 +3744,7 @@ def batch_converter(log_file):
copy_file((Path(export_directory) / export_name), file)

# Archive assets to library.
archive_assets_to_library(item_name, blend, textures_temp_dir, "Low")
archive_assets_to_library(item_name, blend, textures_temp_dir, "Most Optimized")

# Save only single preview image of collections if desired when not archiving assets to library.
if not mark_as_assets and asset_extract_previews:
Expand Down
8 changes: 4 additions & 4 deletions Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,11 @@ class TRANSMOGRIFIER_PG_TransmogrifierSettings(PropertyGroup):
name="Asset Quality",
description="Select the quality of the Blend files containing assets. Quality is based on when asset Blend files are saved during each item's conversion (i.e. before/after textures are resized/reformatted and meshes are decimated). If Edit Textures is empty and Auto-Optimize Files is turned off, asset Blend files will always save at the highest regardless of this menu's selection. If it is desired to run a script before an asset Blend is saved, select 'Low'.\nAsset Quality",
items=[
("Highest", "Highest", "Mark assets before textures are edited according the 'Edit Textures' menu\n(Select this option for the highest quality asset Blend files)", 1),
("Medium", "Medium", "Mark assets after textures are edited according the 'Edit Textures' menu but before meshes and/or textures are automatically optimized according to the 'Auto-Optimize Files' menu\n(Select this option for medium-quality asset Blend files)", 2),
("Low", "Low", "Mark assets after meshes and/or textures are automatically optimized according to the 'Auto-Optimize Files' menu.\n(Select this option for low-quality asset Blend files)", 3),
("Highest Fidelity", "Highest Fidelity", "Mark assets before textures are edited according the 'Edit Textures' menu\n(Select this option for the highest quality asset Blend files)", 1),
("Balanced", "Balanced", "Mark assets after textures are edited according the 'Edit Textures' menu but before meshes and/or textures are automatically optimized according to the 'Auto-Optimize Files' menu\n(Select this option for medium-quality asset Blend files)", 2),
("Most Optimized", "Most Optimized", "Mark assets after meshes and/or textures are automatically optimized according to the 'Auto-Optimize Files' menu.\n(Select this option for lower-quality asset Blend files)", 3),
],
default="Highest",
default="Highest Fidelity",
)
# Mark asset data filter.
asset_types_to_mark: EnumProperty(
Expand Down

0 comments on commit 5de8807

Please sign in to comment.