mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 14:02:47 +00:00
docs(automation): example_slice.py loads model at runtime via file.open
This commit is contained in:
@@ -27,7 +27,6 @@ def main() -> int:
|
||||
args.orca,
|
||||
"--automation-server",
|
||||
f"--automation-server-port={args.port}",
|
||||
args.model,
|
||||
])
|
||||
try:
|
||||
orca = OrcaClient(port=args.port)
|
||||
@@ -43,7 +42,10 @@ def main() -> int:
|
||||
print("ERROR: automation server did not start", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
# Wait until the project (model) is loaded.
|
||||
# Load the model into the already-running instance, then wait until the
|
||||
# project reports loaded. file.open is synchronous, so project_loaded is
|
||||
# already true on return; the wait is a belt-and-suspenders guard.
|
||||
orca.open([args.model])
|
||||
deadline = time.time() + 30
|
||||
while time.time() < deadline:
|
||||
if orca.app_state().get("project_loaded"):
|
||||
|
||||
Reference in New Issue
Block a user