Files
scene-renderer/scene_renderer/properties.py

225 lines
6.9 KiB
Python

import bpy
class SceneRendererSettings(bpy.types.PropertyGroup):
# --- General ---
test_mode: bpy.props.BoolProperty(
name="Test Mode",
description="Render only the first scene at 10% resolution with 1 sample",
default=False,
)
skip_existing: bpy.props.BoolProperty(
name="Skip Existing",
description="Skip scenes whose render file already exists",
default=True,
)
use_cpu: bpy.props.BoolProperty(
name="CPU Only",
description="Force CPU rendering instead of GPU",
default=False,
)
# --- Resolution ---
override_resolution: bpy.props.BoolProperty(
name="Override Resolution",
description="Override the per-scene resolution with a global value",
default=False,
)
resolution_x: bpy.props.IntProperty(
name="Resolution X",
description="Horizontal render resolution",
default=1920, min=1, max=32768,
)
resolution_y: bpy.props.IntProperty(
name="Resolution Y",
description="Vertical render resolution",
default=1080, min=1, max=32768,
)
resolution_percentage: bpy.props.IntProperty(
name="Resolution %",
description="Resolution scale percentage",
default=100, min=1, max=100,
subtype='PERCENTAGE',
)
# --- Sampling ---
samples: bpy.props.IntProperty(
name="Max Samples",
description="Maximum number of Cycles render samples",
default=4096, min=1, max=65536,
)
min_samples: bpy.props.IntProperty(
name="Min Samples",
description=(
"Minimum number of samples before adaptive sampling can stop. "
"Set to 0 to use Blender default"
),
default=0, min=0, max=65536,
)
use_noise_threshold: bpy.props.BoolProperty(
name="Use Noise Threshold",
description="Stop sampling when the noise is below this threshold",
default=True,
)
noise_threshold: bpy.props.FloatProperty(
name="Noise Threshold",
description="Noise threshold for adaptive sampling",
default=0.01, min=0.0001, max=1.0, precision=4,
)
time_limit: bpy.props.FloatProperty(
name="Time Limit",
description=(
"Maximum render time per frame in seconds. "
"0 = no limit"
),
default=0.0, min=0.0, max=86400.0,
)
# --- Denoising ---
use_denoising: bpy.props.BoolProperty(
name="Use Denoising",
description="Enable denoising for final render",
default=True,
)
denoiser: bpy.props.EnumProperty(
name="Denoiser",
description="Which denoiser to use",
items=[
('OPENIMAGEDENOISE', "OpenImageDenoise", "Intel Open Image Denoise (CPU)"),
('OPTIX', "OptiX", "NVIDIA OptiX (GPU only)"),
],
default='OPENIMAGEDENOISE',
)
denoising_input_passes: bpy.props.EnumProperty(
name="Denoise Passes",
description="Passes used by the denoiser for better quality",
items=[
('RGB', "Color", "Use only color data"),
('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data"),
('RGB_ALBEDO_NORMAL', "Color + Albedo + Normal",
"Use color, albedo, and normal data (best quality)"),
],
default='RGB_ALBEDO_NORMAL',
)
# --- Light Bounces ---
max_bounces: bpy.props.IntProperty(
name="Total",
description="Total maximum number of light bounces",
default=12, min=0, max=1024,
)
diffuse_bounces: bpy.props.IntProperty(
name="Diffuse",
description="Maximum number of diffuse bounces",
default=4, min=0, max=1024,
)
glossy_bounces: bpy.props.IntProperty(
name="Glossy",
description="Maximum number of glossy bounces",
default=4, min=0, max=1024,
)
transmission_bounces: bpy.props.IntProperty(
name="Transmission",
description="Maximum number of transmission bounces",
default=12, min=0, max=1024,
)
transparent_max_bounces: bpy.props.IntProperty(
name="Transparent",
description="Maximum number of transparent bounces",
default=8, min=0, max=1024,
)
volume_bounces: bpy.props.IntProperty(
name="Volume",
description="Maximum number of volume scattering bounces",
default=0, min=0, max=1024,
)
# --- Clamping ---
use_clamping: bpy.props.BoolProperty(
name="Use Clamping",
description="Clamp sample values to reduce fireflies",
default=False,
)
clamp_direct: bpy.props.FloatProperty(
name="Direct Light",
description=(
"Clamp value for direct light samples. "
"0 = no clamping"
),
default=0.0, min=0.0, max=1e8,
)
clamp_indirect: bpy.props.FloatProperty(
name="Indirect Light",
description=(
"Clamp value for indirect light samples. "
"0 = no clamping"
),
default=10.0, min=0.0, max=1e8,
)
# --- Film ---
film_transparent: bpy.props.BoolProperty(
name="Transparent Background",
description="Render the background as transparent",
default=True,
)
film_filter_width: bpy.props.FloatProperty(
name="Pixel Filter Width",
description="Pixel filter width for anti-aliasing",
default=1.5, min=0.01, max=10.0,
)
# --- Output ---
output_format: bpy.props.EnumProperty(
name="Format",
description="Output file format",
items=[
('PNG', "PNG", "PNG image with alpha support"),
('JPEG', "JPEG", "JPEG image (no alpha)"),
('TIFF', "TIFF", "TIFF image"),
('OPEN_EXR', "OpenEXR", "OpenEXR HDR image"),
('OPEN_EXR_MULTILAYER', "OpenEXR Multilayer",
"OpenEXR with all render passes"),
],
default='PNG',
)
color_depth: bpy.props.EnumProperty(
name="Color Depth",
description="Bit depth per channel",
items=[
('8', "8 bit", "8 bits per channel"),
('16', "16 bit", "16 bits per channel"),
],
default='16',
)
# --- Color Management ---
exposure: bpy.props.FloatProperty(
name="Exposure",
description="Exposure boost in stops",
default=0.0, soft_min=-3.0, soft_max=3.0,
)
look: bpy.props.EnumProperty(
name="Color Look",
items=[
('None', "None", ""),
('Very Low Contrast', "Very Low Contrast", ""),
('Low Contrast', "Low Contrast", ""),
('Medium Low Contrast', "Medium Low Contrast", ""),
('Medium Contrast', "Medium Contrast", ""),
('Medium High Contrast', "Medium High Contrast", ""),
('High Contrast', "High Contrast", ""),
('Very High Contrast', "Very High Contrast", ""),
],
default='None',
)