presets gui

This commit is contained in:
2025-10-09 12:18:33 +02:00
parent a1556ebce3
commit a14f3af0a1
11 changed files with 8 additions and 65 deletions

View File

@@ -471,7 +471,7 @@ def draw_presets_section(layout, props):
text="Save", icon='FILE_NEW')
# Save with blend file checkbox
layout.prop(props, "save_with_blend_file")
layout.prop(props, "save_with_blend_file", text="Project-specific (only available in this .blend file)")
layout.separator()
@@ -489,19 +489,16 @@ def draw_presets_section(layout, props):
utility_row = layout.row(align=True)
refresh_lock = create_premium_lock_function()
migration_lock = create_premium_lock_function()
safe_operator_call(utility_row, "text_texture.refresh_presets", refresh_lock,
text="Refresh", icon='FILE_REFRESH')
safe_operator_call(utility_row, "text_texture.show_migration_report", migration_lock,
text="Migration Report", icon='INFO')
layout.separator()
# Load presets section - unified list
if props.presets:
pass
layout.label(text=f"📁 Available Presets ({len(props.presets)}):", icon='PRESET')
layout.label(text="Presets", icon='PRESET')
# Sort presets alphabetically for consistent display
sorted_presets = sorted(props.presets, key=lambda p: p.name.lower())
@@ -511,18 +508,10 @@ def draw_presets_section(layout, props):
row = layout.row(align=True)
row.scale_y = 0.9
# Storage indicator icon
if preset.source == 'BLEND_FILE':
pass
icon = '📄' # Blend file indicator
else:
pass
icon = '🏠' # Persistent storage indicator
# Load button with indicator - use safe operator call
# Load button - use safe operator call
load_lock = create_premium_lock_function()
load_btn = safe_operator_call(row, "text_texture.load_preset", load_lock,
text=f"{icon} {preset.name}")
text=preset.name)
if load_btn:
load_btn.preset_name = preset.name
@@ -541,22 +530,10 @@ def draw_presets_section(layout, props):
if delete_btn:
delete_btn.preset_name = preset.name
# Legend for storage indicators
layout.separator()
legend_box = layout.box()
legend_box.scale_y = 0.8
legend_box.label(text="Storage Indicators:", icon='INFO')
legend_box.label(text="🏠 Persistent (survives addon updates)")
legend_box.label(text="📄 Blend file (travels with .blend file)")
else:
pass
layout.label(text="📂 No presets saved yet", icon='INFO')
layout.label(text="💡 Save your first preset above!", icon='LIGHT_DATA')
layout.separator()
info_box = layout.box()
info_box.label(text=" Presets: Persistent by default, blend file optional", icon='INFO')
info_box.label(text="Check the box to save with your .blend file!")
layout.label(text="No presets yet")
layout.label(text="Save your settings above to create your first preset.")
def draw_shader_section(layout, props):
pass