3 Commits

38 changed files with 65 additions and 7 deletions

19
.gitignore vendored
View File

@@ -68,10 +68,21 @@ desktop.ini
# Project-specific directories and files # Project-specific directories and files
.benchmarks/ .benchmarks/
# Marketing - Large binary files # Marketing - Large binary files and assets
marketing/screenrecords/*.mp4 marketing/**/*.mp4
marketing/voice/*.wav marketing/**/*.mov
marketing/*.psd marketing/**/*.wav
marketing/**/*.psd
marketing/**/*.blend
marketing/**/*.blend[0-9]
marketing/screenrecords/
marketing/voice/
marketing/thumbnails/
# Build and Distribution
dist/
*.whl
src/blender_manifest.toml
# Temporary files # Temporary files
*.tmp *.tmp

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

38
src/blender_manifest.toml Normal file
View File

@@ -0,0 +1,38 @@
schema_version = "1.0.0"
# Module ID
id = "text_texture_generator"
# Module version
version = "1.2.5"
# Display name
name = "Text Texture Generator Pro"
# Short description
tagline = "Generate image textures from text with accurate dimensions and instant live preview"
# Maintainer
maintainer = "Marc Mintel <marc@mintel.me>"
# Version: standard or community
type = "add-on"
# Support: Community, Official or Core
support = "COMMUNITY"
# Website URI
website = "https://mintel.me"
# Common tags
tags = ["Material", "Shader", "Texture", "Text", "Image"]
# Minimum Blender version
blender_version_min = "4.0.0"
# License
license = ["GPL-3.0-or-later"]
[permissions]
# files = "Read and write access to files"
# network = "Access to the Internet"

View File

@@ -150,7 +150,10 @@ def generate_texture_image(props, width, height):
try: try:
text_bbox = temp_draw.textbbox((0, 0), text_value, font=text_font) text_bbox = temp_draw.textbbox((0, 0), text_value, font=text_font)
except Exception: except Exception:
font_size_val = getattr(props, 'font_size', 100) try:
font_size_val = int(getattr(props, 'font_size', 100))
except (ValueError, TypeError):
font_size_val = 100
width = font_size_val * len(text_value) * 0.6 width = font_size_val * len(text_value) * 0.6
height = font_size_val height = font_size_val
text_bbox = (0, 0, width, height) text_bbox = (0, 0, width, height)
@@ -903,9 +906,15 @@ def generate_preview(props, preview_width=None, preview_height=None):
pass pass
# Use full texture resolution when not explicitly provided # Use full texture resolution when not explicitly provided
if not preview_width or preview_width <= 0: if not preview_width or preview_width <= 0:
preview_width = getattr(props, 'texture_width', 512) or 512 try:
preview_width = int(getattr(props, 'texture_width', 512))
except (ValueError, TypeError):
preview_width = 512
if not preview_height or preview_height <= 0: if not preview_height or preview_height <= 0:
preview_height = getattr(props, 'texture_height', 512) or 512 try:
preview_height = int(getattr(props, 'texture_height', 512))
except (ValueError, TypeError):
preview_height = 512
# Generate at preview resolution # Generate at preview resolution
result = generate_texture_image(props, preview_width, preview_height) result = generate_texture_image(props, preview_width, preview_height)