2026-01-12 07:30:02 +01:00
|
|
|
import bonsai, json, bpy
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
repo_path = Path(bonsai.__file__).resolve().parent
|
|
|
|
|
install_path = Path(bonsai.__file__).absolute().parent
|
|
|
|
|
assert repo_path != install_path, "Run `dev_environment.py` to setup the development environment symlinks first."
|
|
|
|
|
|
|
|
|
|
repo_root = repo_path.parent.parent.parent
|
|
|
|
|
settings_path = repo_root / ".vscode" / "settings.json"
|
|
|
|
|
settings_path.parent.mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
settings = json.loads(settings_path.read_text()) if settings_path.exists() else {}
|
2026-01-12 16:07:34 +05:00
|
|
|
settings.update(
|
|
|
|
|
{
|
|
|
|
|
"bonsai.localRoot": repo_path.as_posix(),
|
|
|
|
|
"bonsai.remoteRoot": install_path.as_posix(),
|
|
|
|
|
"bonsai.blenderPath": Path(bpy.app.binary_path).parent.as_posix(),
|
|
|
|
|
}
|
|
|
|
|
)
|
2026-01-12 07:30:02 +01:00
|
|
|
json_data = json.dumps(settings, indent=2)
|
|
|
|
|
|
|
|
|
|
settings_path.write_text(json_data)
|
|
|
|
|
|
|
|
|
|
print("\n\nBonsai/VSCode development environment configured successfully!\n\n")
|