This commit is contained in:
2025-10-13 16:56:38 +02:00
parent bf636cbc66
commit 57b55b10a2
21 changed files with 624 additions and 202 deletions

View File

@@ -85,6 +85,21 @@ def draw_collapsible_header(layout, prop_name, text, icon='TRIA_DOWN'):
return box if expanded else None
def draw_premium_collapsible_section(layout, prop_name, title, icon, availability_func):
"""Draw a collapsible header that locks when feature is unavailable."""
header_row = layout.row(align=True)
try:
available = availability_func()
except Exception:
available = False
if not available:
header_row.enabled = False
lock_header = header_row.row()
lock_header.label(text=title, icon=icon)
lock_header.label(text="🔒 PRO", icon='LOCKED')
return None
return draw_collapsible_header(header_row, prop_name, title, icon)
def draw_version_badge(layout):
pass
"""Draw version badge in panel header"""
@@ -151,7 +166,10 @@ def draw_version_info_section(layout, props):
limits_col = col.column(align=True)
limits_col.separator()
limits_col.label(text="Current Limits:")
limits_col.label(text=f"• Max texture size: {version_info['max_texture_size']}px")
max_texture_display = version_info['max_texture_size']
if isinstance(max_texture_display, (int, float)):
max_texture_display = f"{int(max_texture_display)}px"
limits_col.label(text=f"• Max texture size: {max_texture_display}")
limits_col.label(text=f"• Active features: {version_info['features_enabled']}")
# Feature availability status
@@ -989,7 +1007,13 @@ class TEXT_TEXTURE_PT_panel(Panel):
draw_shader_options_only(shader_expanded, props)
# Composition Section (collapsed by default)
composition_section = draw_collapsible_header(layout, "expand_composition", "Composition", 'SEQ_PREVIEW')
composition_section = draw_premium_collapsible_section(
layout,
"expand_composition",
"Composition",
'SEQ_PREVIEW',
has_image_overlays
)
if composition_section:
draw_composition_section(composition_section, props)
@@ -1186,7 +1210,13 @@ class TEXT_TEXTURE_PT_panel_3d(Panel):
draw_shader_options_only(shader_expanded, props)
# Composition Section (collapsed by default)
composition_section = draw_collapsible_header(layout, "expand_composition", "Composition", 'SEQ_PREVIEW')
composition_section = draw_premium_collapsible_section(
layout,
"expand_composition",
"Composition",
'SEQ_PREVIEW',
has_image_overlays
)
if composition_section:
draw_composition_section(composition_section, props)
@@ -1363,7 +1393,13 @@ class TEXT_TEXTURE_PT_panel_properties(Panel):
# === PREMIUM FEATURES ===
# Composition Section (collapsed by default)
composition_section = draw_collapsible_header(layout, "expand_composition", "Composition", 'SEQ_PREVIEW')
composition_section = draw_premium_collapsible_section(
layout,
"expand_composition",
"Composition",
'SEQ_PREVIEW',
has_image_overlays
)
if composition_section:
draw_composition_section(composition_section, props)