no bpy dll path

This commit is contained in:
Andrea Pozzetti
2026-02-13 00:33:40 +01:00
parent dfabf9983c
commit faafaeb7bf
2 changed files with 0 additions and 47 deletions
-20
View File
@@ -10,26 +10,6 @@ These are internal implementation details and should not be imported directly by
import os
import sys
def setup_bpy_dll_path():
"""Add bpy's DLL directory to the search path (required for Python 3.8+ on Windows).
Python 3.8+ changed DLL loading - it no longer uses PATH. The bpy package has
70+ DLLs that need to be found when importing. This function adds the bpy
package directory to the DLL search path.
Must be called BEFORE `import bpy`.
"""
if sys.platform == "win32":
try:
import importlib.util
spec = importlib.util.find_spec("bpy")
if spec and spec.origin:
bpy_dir = os.path.dirname(spec.origin)
os.add_dll_directory(bpy_dir)
except Exception:
pass # Best effort
# Re-export commonly used utilities for convenience
from .mesh_ops import *
-27
View File
@@ -1,27 +0,0 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2025 ComfyUI-GeometryPack Contributors
"""Blender-specific utilities."""
import os
import sys
def setup_bpy_dll_path():
"""Add bpy's DLL directory to the search path (required for Python 3.8+ on Windows).
Python 3.8+ changed DLL loading - it no longer uses PATH. The bpy package has
70+ DLLs that need to be found when importing. This function adds the bpy
package directory to the DLL search path.
Must be called BEFORE `import bpy`.
"""
if sys.platform == "win32":
try:
import importlib.util
spec = importlib.util.find_spec("bpy")
if spec and spec.origin:
bpy_dir = os.path.dirname(spec.origin)
os.add_dll_directory(bpy_dir)
except Exception:
pass # Best effort