mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-31 14:52:06 +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,
|
args.orca,
|
||||||
"--automation-server",
|
"--automation-server",
|
||||||
f"--automation-server-port={args.port}",
|
f"--automation-server-port={args.port}",
|
||||||
args.model,
|
|
||||||
])
|
])
|
||||||
try:
|
try:
|
||||||
orca = OrcaClient(port=args.port)
|
orca = OrcaClient(port=args.port)
|
||||||
@@ -43,7 +42,10 @@ def main() -> int:
|
|||||||
print("ERROR: automation server did not start", file=sys.stderr)
|
print("ERROR: automation server did not start", file=sys.stderr)
|
||||||
return 1
|
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
|
deadline = time.time() + 30
|
||||||
while time.time() < deadline:
|
while time.time() < deadline:
|
||||||
if orca.app_state().get("project_loaded"):
|
if orca.app_state().get("project_loaded"):
|
||||||
|
|||||||
Reference in New Issue
Block a user