v0.3: PySide2 mini-UI panel + installer
- New: hermes_bridge_panel.py — PySide2 floating panel with: - Port configuration (spinner) - Open/Close toggle with green/red status - Auto-detected hostname - One-click copy prompt: 'Hey Hermes, I have Houdini on [host] port [N]' - Persists port setting across sessions - New: install.py — auto-detects houdini dir, copies panel + shelf - New: hermes_bridge.shelf — shelf tool integration - Updated: README with panel usage instructions
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Install Hermes Bridge into Houdini.
|
||||
|
||||
Copies the Python panel to ~/houdini21.0/scripts/python/
|
||||
and the shelf tool to ~/houdini21.0/toolbar/
|
||||
|
||||
Usage: python install.py [--houdini-dir ~/houdini21.0]
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import argparse
|
||||
|
||||
FILES = {
|
||||
"hermes_bridge_panel.py": "scripts/python/",
|
||||
"hermes_bridge.shelf": "toolbar/",
|
||||
}
|
||||
|
||||
|
||||
def get_houdini_dir():
|
||||
"""Auto-detect Houdini prefs directory."""
|
||||
home = os.path.expanduser("~")
|
||||
for d in sorted(os.listdir(home), reverse=True):
|
||||
if d.startswith("houdini") and os.path.isdir(os.path.join(home, d)):
|
||||
return os.path.join(home, d)
|
||||
return os.path.join(home, "houdini21.0")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Install Hermes Bridge into Houdini")
|
||||
parser.add_argument(
|
||||
"--houdini-dir",
|
||||
default=get_houdini_dir(),
|
||||
help=f"Houdini preferences directory (default: {get_houdini_dir()})",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
src_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
for filename, subdir in FILES.items():
|
||||
src = os.path.join(src_dir, filename)
|
||||
dst_dir = os.path.join(os.path.expanduser(args.houdini_dir), subdir)
|
||||
dst = os.path.join(dst_dir, filename)
|
||||
|
||||
if not os.path.exists(src):
|
||||
print(f" SKIP {filename} — source not found")
|
||||
continue
|
||||
|
||||
os.makedirs(dst_dir, exist_ok=True)
|
||||
shutil.copy2(src, dst)
|
||||
print(f" COPY {filename} -> {dst}")
|
||||
|
||||
print(f"\nInstalled to {args.houdini_dir}")
|
||||
print("Restart Houdini — the shelf tool appears under 'Hermes Bridge'.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user