From bc24e528d37bdbd8f93090bb4bc39dcce15a5024 Mon Sep 17 00:00:00 2001 From: Andrea Pozzetti Date: Thu, 12 Feb 2026 22:55:40 +0100 Subject: [PATCH] new init --- __init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 5634f64a..d004b4c7 100644 --- a/__init__.py +++ b/__init__.py @@ -28,6 +28,17 @@ if 'PYTEST_CURRENT_TEST' not in os.environ: print("[GeomPack] CGAL and Blender operations will not be available") print("[GeomPack] Run 'comfy-env install' to create the isolated environment") + # Setup import stubs BEFORE importing nodes + # This allows imports like 'import trimesh' to succeed even though + # trimesh is only installed in the isolated pixi environment + try: + from comfy_env import setup_isolated_imports + setup_isolated_imports(__file__) + except ImportError: + print("[GeomPack] comfy-env not installed, import stubbing disabled") + except Exception as e: + print(f"[GeomPack] Failed to setup import stubs: {e}") + from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS # Enable process isolation - all nodes run in pixi env (Python 3.11) @@ -35,7 +46,7 @@ if 'PYTEST_CURRENT_TEST' not in os.environ: from comfy_env import enable_isolation enable_isolation(NODE_CLASS_MAPPINGS) except ImportError: - print("[GeomPack] comfy-env not installed, isolation disabled") + pass # Already warned above except Exception as e: print(f"[GeomPack] Failed to enable isolation: {e}")