bundle svg

This commit is contained in:
2025-10-13 19:08:28 +02:00
parent e3a8f0bcf0
commit fe2e81ecd0
43 changed files with 187 additions and 46 deletions

View File

@@ -87,11 +87,16 @@ def ensure_svg_raster(image_path: str, scale: float) -> RasterizationResult:
try:
import cairosvg # type: ignore
except ImportError as import_error:
raise SVGConversionError(
"SVG overlay support requires the 'cairosvg' package. "
"Install it via pip (pip install cairosvg) inside Blender's Python environment."
) from import_error
except ImportError:
try:
from .system import install_cairosvg_from_bundle
install_cairosvg_from_bundle()
import cairosvg # type: ignore # noqa: F401
except Exception as install_error:
raise SVGConversionError(
"SVG overlay support requires CairoSVG, but the bundled installation failed. "
"Please reinstall the addon or install CairoSVG manually inside Blender's Python environment."
) from install_error
# Guard against invalid scales (NaN, infinity, zero, negative)
if not isinstance(scale, (int, float)) or not math.isfinite(scale):