Skip to content

Commit bc7b101

Browse files
docs: reference canonical submission-hooks doc instead of duplicating (#533)
Replace the duplicated "Pre-GUI Submission Hooks" README section with a concise "Submission Hooks" reference. DCC repos should point to the canonical documentation in the AWS Deadline Cloud client library rather than maintaining their own copy of the hooks.yaml format, field lists, and caveats. Keeps a short Cinema 4D-specific note (hooks sourced from DEADLINE_HOOKS_DIR, enabled via settings.allow_environment_hooks, opened from Extensions > AWS Deadline Cloud Submitter) and links the base doc for the rest. Docs only. Signed-off-by: Leon Li <2182521+leon-li-inspire@users.noreply.github.com>
1 parent d71a609 commit bc7b101

1 file changed

Lines changed: 13 additions & 88 deletions

File tree

README.md

Lines changed: 13 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For instructions on installing and using this integration, visit the [user guide
1313
[cmf-ubl]: https://docs.aws.amazon.com/deadline-cloud/latest/developerguide/cmf-ubl.html
1414
[deadline-cloud]: https://docs.aws.amazon.com/deadline-cloud/latest/userguide/what-is-deadline-cloud.html
1515
[deadline-cloud-client]: https://github.com/aws-deadline/deadline-cloud
16-
[submission-hooks]: https://github.com/aws-deadline/deadline-cloud#submission-hooks
16+
[submission-hooks]: https://github.com/aws-deadline/deadline-cloud/blob/mainline/docs/submission-hooks.md
1717
[openjd-template]: https://github.com/OpenJobDescription/openjd-specifications/wiki/2023-09-Template-Schemas
1818
[openjd-adaptor-runtime]: https://github.com/OpenJobDescription/openjd-adaptor-runtime-for-python
1919
[openjd-adaptor-runtime-lifecycle]: https://github.com/OpenJobDescription/openjd-adaptor-runtime-for-python/blob/release/README.md#adaptor-lifecycle
@@ -140,98 +140,23 @@ chmod +x ~/Desktop/Cinema4D.command
140140

141141
To open Cinema 4D on Mac, click `Cinema4D.command` on your desktop. After you load a scene, click on `Extensions` > `AWS Deadline Cloud Submitter` to view the submitter.
142142

143-
## Pre-GUI Submission Hooks
144-
145-
The Cinema 4D submitter supports **pre-GUI hooks** — studio-provided scripts that run *before* the
146-
`Submit to AWS Deadline Cloud` dialog opens, so you can pre-populate the job name, description, and
147-
shared job properties (priority, maximum failed tasks, maximum retries, Conda packages, etc.). This
148-
is useful for enforcing studio defaults or pulling values from a pipeline / asset-management system
149-
before an artist sees the dialog.
150-
151-
Pre-GUI hooks are provided by the [AWS Deadline Cloud client library][deadline-cloud-client] and are
152-
shared across DCC submitters. For Cinema 4D, hooks are sourced only from the directory named by the
153-
`DEADLINE_HOOKS_DIR` environment variable — the Cinema 4D submitter has no on-disk job bundle at
154-
pre-GUI time, so bundle-sourced hooks do not apply. They complement the `preSubmission` /
155-
`postSubmission` hooks that run at submit time (see [Submission Hooks][submission-hooks]).
156-
157-
Pre-GUI hook support requires the `deadline` client library that ships with
158-
`deadline-cloud-for-cinema-4d[gui]` (`deadline[gui] >= 0.60.4`), which is installed for you when you
159-
install the submitter as described above.
160-
161-
### Enabling pre-GUI hooks
162-
163-
1. Allow environment-sourced hooks in your Deadline Cloud configuration (off by default):
164-
```
165-
deadline config set settings.allow_environment_hooks true
166-
```
167-
2. Point `DEADLINE_HOOKS_DIR` at a directory that holds your hook script(s) and a `hooks.yaml`.
168-
169-
On Windows (`cmd`):
170-
```cmd
171-
setx DEADLINE_HOOKS_DIR "C:\deadline-hooks"
172-
```
173-
On macOS/Linux:
174-
```
175-
export DEADLINE_HOOKS_DIR="$HOME/deadline-hooks"
176-
```
177-
Restart Cinema 4D (or log out/in on Windows) so the running Cinema 4D process picks up the
178-
environment variable before you open the submitter.
179-
3. Create `hooks.yaml` in that directory with a `preGUI` entry:
180-
```yaml
181-
preGUI:
182-
- command: C:/Program Files/Python311/python.exe
183-
args:
184-
- C:/deadline-hooks/pregui_hook.py
185-
timeout: 60
186-
```
187-
**Tip:** point `command` at a clean, standalone Python interpreter rather than Cinema 4D's
188-
bundled interpreter — a bundled interpreter can print a startup banner to stdout that corrupts
189-
the hook's JSON output.
190-
191-
### Writing a pre-GUI hook
192-
193-
A pre-GUI hook receives the current submission metadata as JSON on **stdin** and returns the fields
194-
it wants to override as JSON on **stdout**. Recognized keys are `name`, `description`, and
195-
`parameters` (a map of parameter name → value). `deadline:`-prefixed keys map to shared job
196-
properties — for example `deadline:priority`, `deadline:maxFailedTasksCount`, and
197-
`deadline:maxRetriesPerTask` — and `CondaPackages` overrides the Conda packages queue parameter.
198-
199-
```python
200-
# pregui_hook.py
201-
import json, sys
202-
203-
metadata = json.load(sys.stdin) # jobName, submitterName ("cinema4d"), parameters, farmId, queueId, ...
204-
205-
print(json.dumps({
206-
"name": "MyStudio Shot 010",
207-
"description": "Submitted via MyStudio pipeline",
208-
"parameters": {
209-
"deadline:priority": 75,
210-
"deadline:maxFailedTasksCount": 5,
211-
},
212-
}))
213-
```
214-
215-
When the submitter opens, its **Name** / **Description** and **Priority** / **Maximum failed tasks
216-
count** / **Maximum retries per task** fields on the shared job settings tab (plus any other
217-
returned shared parameters, such as `CondaPackages`) are pre-populated from the hook's output.
143+
## Submission Hooks
218144

219-
> **Note:** pre-GUI hooks set the shared job properties above; they do **not** set the Cinema
220-
> 4D-specific render options (take selection, frame range, output path, multi-pass path, tile
221-
> rendering, chunk size, error checking, detailed logging, etc.). Those are initialized from the
222-
> Cinema 4D scene's render settings and the per-scene sticky settings, and remain editable in the
223-
> submitter UI.
145+
The Cinema 4D submitter supports Deadline Cloud **submission hooks** — studio-provided scripts that
146+
run at submission time to customize a job. Pre-GUI hooks run *before* the `Extensions` > `AWS
147+
Deadline Cloud Submitter` dialog opens (to pre-populate fields such as the job name, description,
148+
and priority); pre-submission and post-submission hooks run around job creation.
224149

225-
### Confirmation prompt
226-
227-
Before running any hooks, the submitter shows a **Job Submission Confirmation** dialog listing the
228-
hook scripts that will execute. Click **Yes** to run them, or **No** to cancel — clicking **No**
229-
aborts opening the submitter cleanly (no error). To skip the prompt on non-interactive or
230-
studio-locked workstations, enable auto-accept:
150+
Hooks are sourced from the directory named by the `DEADLINE_HOOKS_DIR` environment variable, which
151+
must first be enabled in your Deadline Cloud configuration:
231152
```
232-
deadline config set settings.auto_accept true
153+
deadline config set settings.allow_environment_hooks true
233154
```
234155

156+
For the `hooks.yaml` format, the data passed to hooks, the fields you can override, and the
157+
confirmation-prompt and failure behavior, see the canonical documentation in the AWS Deadline Cloud
158+
client library: [Submission Hooks][submission-hooks].
159+
235160
## Adaptor
236161

237162
Jobs created by the Cinema 4D submitter require the adaptor to be installed on your worker hosts.

0 commit comments

Comments
 (0)