text fitting pro feature

This commit is contained in:
2025-10-10 14:41:18 +02:00
parent 0edf324335
commit 596f640912
23 changed files with 909 additions and 86 deletions

View File

@@ -1,19 +0,0 @@
schema_version = "1.0.0"
id = "text_texture_generator"
version = "1.0.0"
name = "Text Texture Generator"
tagline = "Generate image textures from text with accurate dimensions and instant live preview"
maintainer = "Marc Mintel <marc@mintel.me>"
type = "add-on"
support = "COMMUNITY"
tags = ["Material", "Shader", "Texture", "Text", "Image"]
blender_version_min = "4.0.0"
license = ["GPL-3.0-or-later"]
# Dependencies
[dependencies]
pillow = ">=10.0.0"

View File

@@ -4,6 +4,7 @@ Core functionality for generating texture images with text overlays.
"""
import bpy
from ..utils.constants import has_text_fitting
def generate_texture_image(props, width, height):
pass
@@ -102,7 +103,7 @@ def generate_texture_image(props, width, height):
# Determine font size (with text fitting if enabled)
font_size = props.font_size
if props.enable_text_fitting:
if props.enable_text_fitting and has_text_fitting():
pass
# Try to load font for sizing

View File

@@ -12,7 +12,7 @@ from ..utils.constants import (
get_feature_availability_text, get_version_info_details,
has_image_overlays, has_basic_utilities, has_presets,
has_normal_maps, has_batch_processing, has_advanced_utilities,
has_advanced_styling
has_advanced_styling, has_text_fitting
)
@@ -655,8 +655,11 @@ def draw_normal_maps_section(layout, props):
info_box.label(text="• Invert changes raised/recessed effect")
def draw_text_fitting_section(layout, props):
pass
"""Draw text fitting controls"""
# Check if text fitting is available
if not has_text_fitting():
draw_feature_lock_indicator(layout, 'text_fitting')
return
# Main toggle for text fitting
layout.prop(props, "enable_text_fitting", text="Enable Text Fitting", icon='FULLSCREEN_ENTER')
@@ -890,22 +893,11 @@ class TEXT_TEXTURE_PT_panel(Panel):
@classmethod
def poll(cls, context):
pass
# DEBUG: Log poll method calls
if hasattr(context.space_data, 'tree_type'):
pass
else:
pass
# More permissive poll condition to ensure panel shows up
"""Show panel in Shader Editor only"""
if context.space_data.type == 'NODE_EDITOR':
pass
if hasattr(context.space_data, 'tree_type'):
pass
result = context.space_data.tree_type == 'ShaderNodeTree'
return result
return context.space_data.tree_type == 'ShaderNodeTree'
else:
pass
# Allow panel even without tree_type (sometimes happens)
return True

View File

@@ -19,7 +19,8 @@ bl_info = {
ENABLED_FEATURES = ["basic", "preview"] if VERSION_TYPE == "free" else [
"basic", "preview", "presets", "normal_maps", "batch_processing",
"image_overlays", "basic_utilities", "advanced_utilities", "advanced_styling",
"stroke_effects", "blur_effects", "shadow_glow_effects", "shader_generation"
"stroke_effects", "blur_effects", "shadow_glow_effects", "shader_generation",
"text_fitting"
]
# Version-specific limits (applied at build time through file exclusions)
@@ -109,6 +110,10 @@ def has_shader_generation():
"""Check if shader generation is available"""
return has_feature("shader_generation")
def has_text_fitting():
"""Check if text fitting is available"""
return has_feature("text_fitting")
def get_max_resolution():
"""Get maximum texture resolution based on version"""
limits = get_version_limits()
@@ -128,7 +133,8 @@ def should_show_feature_lock(feature_name):
'stroke_effects': has_stroke_effects,
'blur_effects': has_blur_effects,
'shadow_glow_effects': has_shadow_glow_effects,
'shader_generation': has_shader_generation
'shader_generation': has_shader_generation,
'text_fitting': has_text_fitting
}
if is_full_version():