87 lines
4.3 KiB
Python
87 lines
4.3 KiB
Python
# config.py
|
|
# Core settings defining the pipeline standards and output format.
|
|
|
|
# --- Target Output Standards ---
|
|
TARGET_FILENAME_PATTERN = "{base_name}_{map_type}_{resolution}.{ext}"
|
|
STANDARD_MAP_TYPES = [
|
|
"COL", "NRM", "ROUGH", "METAL", "AO", "DISP", "REFL",
|
|
"SSS", "FUZZ", "IDMAP", "MASK"
|
|
]
|
|
# Map types that should always receive a numeric suffix (e.g., COL-1, COL-2)
|
|
# based on preset keyword order, even if only one variant is found.
|
|
RESPECT_VARIANT_MAP_TYPES = ["COL"]
|
|
|
|
# Subdirectory within the final set folder for non-essential/unknown files
|
|
EXTRA_FILES_SUBDIR = "Extra"
|
|
OUTPUT_BASE_DIR = "../Asset_Processor_Output" #accepts both relative and absolute paths
|
|
METADATA_FILENAME = "metadata.json"
|
|
|
|
# --- Blender Integration Settings ---
|
|
# Default paths to Blender files for node group and material creation.
|
|
# Set these to absolute or relative paths if you want defaults.
|
|
# Command-line arguments (--nodegroup-blend, --materials-blend) will override these.
|
|
DEFAULT_NODEGROUP_BLEND_PATH = r"G:/02 Content/10-19 Content/19 Catalogs/19.01 Blender Asset Catalogue/_CustomLibraries/Nodes-Linked/PBRSET-Nodes-Testing.blend" # e.g., r"G:\Blender\Libraries\NodeGroups.blend"
|
|
DEFAULT_MATERIALS_BLEND_PATH = r"G:/02 Content/10-19 Content/19 Catalogs/19.01 Blender Asset Catalogue/_CustomLibraries/Materials-Append/PBR Materials-Testing.blend" # e.g., r"G:\Blender\Libraries\Materials.blend"
|
|
# Path to the Blender executable. Required for running Blender scripts.
|
|
# Example: r"C:\Program Files\Blender Foundation\Blender 3.6\blender.exe"
|
|
BLENDER_EXECUTABLE_PATH = r"C:/Program Files/Blender Foundation/Blender 4.4/blender.exe" # <<< SET THIS PATH!
|
|
|
|
# --- Image Processing Settings ---
|
|
# Target resolutions (Largest dimension in pixels)
|
|
PNG_COMPRESSION_LEVEL = 6 # 0 (none) to 9 (max)
|
|
# Quality for JPG output (0-100)
|
|
JPG_QUALITY = 98
|
|
# Resolution dimension threshold (pixels) above which 8-bit images are forced to JPG, overriding input format logic.
|
|
RESOLUTION_THRESHOLD_FOR_JPG = 4096
|
|
IMAGE_RESOLUTIONS = {"8K": 8192,"4K": 4096, "2K": 2048, "1K": 1024}
|
|
# Aspect ratio decimals (used for metadata, could potentially be removed later)
|
|
ASPECT_RATIO_DECIMALS = 2
|
|
# Bit depth rules per standard map type ('respect' or 'force_8bit')
|
|
MAP_BIT_DEPTH_RULES = {
|
|
"COL": "force_8bit", "NRM": "respect", "ROUGH": "force_8bit", "METAL": "force_8bit",
|
|
"AO": "force_8bit", "DISP": "respect", "REFL": "force_bit", "SSS": "respect",
|
|
"FUZZ": "force_bit", "IDMAP": "force_8bit", "MASK": "force_8bit",
|
|
"DEFAULT": "respect" # Fallback for map types not listed
|
|
}
|
|
# Output format preferences for 16-bit data
|
|
OUTPUT_FORMAT_16BIT_PRIMARY = "png" # Options: exr_dwaa, exr_dwab, exr_zip, png, tif
|
|
OUTPUT_FORMAT_16BIT_FALLBACK = "png"
|
|
# Output format for 8-bit data
|
|
OUTPUT_FORMAT_8BIT = "png" # Could allow 'jpg' later with quality settings
|
|
|
|
# Map types that should always be saved in a lossless format (e.g., PNG, EXR)
|
|
# regardless of resolution threshold or input format.
|
|
#FORCE_LOSSLESS_MAP_TYPES = ["NRM", "NRMRGN"]
|
|
|
|
# --- Map Merging Rules ---
|
|
# List of dictionaries, each defining a merge operation.
|
|
MAP_MERGE_RULES = [
|
|
{
|
|
"output_map_type": "NRMRGH", # Suffix or standard name for the merged map
|
|
"inputs": { # Map target RGB channels to standard input map type names
|
|
"R": "NRM", # Use Red channel from NRM
|
|
"G": "NRM", # Use Green channel from NRM
|
|
"B": "ROUGH" # Use Red channel from ROUGH (assuming it's grayscale)
|
|
},
|
|
"defaults": { # Default values (0.0 - 1.0) if an input map is missing
|
|
"R": 0.5, "G": 0.5, "B": 0.5
|
|
},
|
|
# 'respect_inputs' (use 16bit if any input is), 'force_8bit', 'force_16bit'
|
|
"output_bit_depth": "respect_inputs"
|
|
},
|
|
# Example: Merge Metalness(R), Roughness(G), AO(B) -> "MRA" map often used in engines
|
|
# {
|
|
# "output_map_type": "MRA",
|
|
# "inputs": {"R": "METAL", "G": "ROUGH", "B": "AO"},
|
|
# "defaullllts": {"R": 0.0, "G": 1.0, "B": 1.0}, # Default Metal=0, Rough=1, AO=1
|
|
# "output_bit_depth": "force_8bit" # Usually fine as 8bit
|
|
# },
|
|
]
|
|
|
|
# --- Metadata Settings ---
|
|
CALCULATE_STATS_RESOLUTION = "1K" # Resolution suffix used for calculating stats
|
|
DEFAULT_ASSET_CATEGORY = "Surface" # If rules don't identify Asset or Decal
|
|
|
|
# --- Internal Settings ---
|
|
# Temporary directory prefix for processing folders
|
|
TEMP_DIR_PREFIX = "_PROCESS_ASSET_" |