Point the Blender add-on at CultLib's three Python packages

CultLib's Python runtime is now cultcache-py, cultnet-py and cultmesh-py,
one per layer like the Rust crates. `CultLib Python Source` therefore
names the CultLib packages directory and the loader puts each package's
src on sys.path, instead of one src directory that no longer holds all
three modules. The default also leaves E:\, which has not existed since
the July 2026 relocation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-10 13:10:53 +02:00
commit 12f9169a48
3 changed files with 19 additions and 12 deletions

View file

@ -50,7 +50,7 @@ class BrokkrPreferences(bpy.types.AddonPreferences):
name="CultLib Python Source",
subtype="DIR_PATH",
default=DEFAULT_CULTLIB_PY_SRC,
description="Path to CultLib packages/cultcache-py/src when cultcache-py is not installed in Blender",
description="Path to the CultLib packages directory when cultcache-py, cultnet-py and cultmesh-py are not installed in Blender",
)
debug_mirror_root: bpy.props.StringProperty(

View file

@ -13,7 +13,11 @@ PROVIDER_ID = "brokkr.blender_editor"
TOOL_KIND = "blender-editor"
DEFAULT_BROKER_URI = "cultmesh://brokkr"
DEFAULT_CULTMESH_CACHE_PATH = "//.brokkr/blender-editor.ccmp"
DEFAULT_CULTLIB_PY_SRC = "E:/Projects/CultLib-main-work/packages/cultcache-py/src"
# The CultLib `packages` directory. The Python runtime is three layered
# packages there (cultcache-py, cultnet-py, cultmesh-py); each one's `src` is
# added to sys.path when they are not installed into Blender's interpreter.
DEFAULT_CULTLIB_PY_SRC = "F:/Projects/CultLib/packages"
CULTLIB_PY_PACKAGES = ("cultcache-py", "cultnet-py", "cultmesh-py")
DEFAULT_DEBUG_MIRROR_ROOT = "//.brokkr/blender-editor-debug"
HOST_SNAPSHOT_SCHEMA = "brokkr.blender.host_snapshot.v0"
@ -692,18 +696,20 @@ class BrokkrBlenderTarget:
def _load_cultmesh(cultlib_py_src: str) -> tuple[Any, Any]:
source = Path(cultlib_py_src or DEFAULT_CULTLIB_PY_SRC)
if source.exists():
source_text = str(source)
if source_text not in sys.path:
sys.path.insert(0, source_text)
packages = Path(cultlib_py_src or DEFAULT_CULTLIB_PY_SRC)
for name in CULTLIB_PY_PACKAGES:
source = packages / name / "src"
if source.exists():
source_text = str(source)
if source_text not in sys.path:
sys.path.insert(0, source_text)
try:
import cultmesh_py # type: ignore
import cultcache_py # type: ignore
except ModuleNotFoundError as exc:
raise RuntimeError(
"Brokkr Blender target requires CultLib's Python CultMesh package. Set CultLib Python Source "
"to the CultLib packages/cultcache-py/src directory or install cultcache-py into Blender's Python."
"Brokkr Blender target requires CultLib's Python packages. Set CultLib Python Source "
"to the CultLib packages directory or install cultcache-py, cultnet-py and cultmesh-py into Blender's Python."
) from exc
return cultmesh_py, cultcache_py

View file

@ -8,11 +8,12 @@ target surface for host snapshots, admitted command intents, and command
receipts.
The adapter writes its mirror documents through CultLib's Python CultMesh node.
If `cultcache-py`/`cultmesh_py` is not installed into Blender's Python, point
`CultLib Python Source` at:
If `cultcache-py`, `cultnet-py` and `cultmesh-py` are not installed into
Blender's Python, point `CultLib Python Source` at the CultLib packages
directory; the add-on puts each package's `src` on `sys.path`:
```text
E:/Projects/CultLib-main-work/packages/cultcache-py/src
F:/Projects/CultLib/packages
```
The default node cache is: