bundle svg
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user