Run Process
This page explains how to launch DCC applications in batch/headless mode via puzzle2.run_process and where artifacts are written.
What it does
- Resolves the executable/arguments for the requested app/version
- Creates an isolated job directory per run
- Writes artifacts like
results.jsonandstd.txt - Optionally generates a
.batinstead of executing immediately
Key parameters
- module_directory_path: Where your tasks (e.g.,
tasks.win.*) live - task_set_path or task_set: Task set file (.yml/.json) or in-memory data
- data_path or data_set: Data file (.json) or in-memory data
- result_path: Where to write results.json (default inside job_directory)
- version: DCC version like
2024 - close_app: Whether to close the app after processing
- execute_now: If false, generate a
.batand return - bat_file: Path to write the
.batfile whenexecute_nowis false
Minimal example (Maya 2024)
from puzzle2.run_process import run_process
cmd = {
"module_directory_path": r"C:\\path\\to\\tests_data",
"task_set_path": r"C:\\path\\to\\task_set.yml",
"data_path": r"C:\\path\\to\\data.json",
"result_path": r"C:\\tmp\\results.json",
"execute_now": False,
"bat_file": r"C:\\tmp\\puzzle2.bat",
"close_app": True,
"version": "2024",
}
app = "maya"
command, job_dir = run_process(app, **cmd)
print(command, job_dir)