You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document pre-GUI submission hooks for Cinema 4D
Add a "Pre-GUI Submission Hooks" section to the README covering the
pre-GUI hook support added to the Cinema 4D submitter (PR #480):
- enabling env-sourced hooks (settings.allow_environment_hooks) and
pointing DEADLINE_HOOKS_DIR at a hooks directory;
- a hooks.yaml preGUI entry and a sample pregui_hook.py that reads the
submission metadata on stdin and returns name/description/parameters
(incl. deadline: job properties and CondaPackages) on stdout;
- which submitter fields get pre-populated (Name/Description + the
shared job-settings fields) and which Cinema 4D scene/render settings
are NOT touched by the hook;
- the Job Submission Confirmation prompt and settings.auto_accept.
Docs only; no code changes.
Signed-off-by: Leon Li <2182521+leon-li-inspire@users.noreply.github.com>
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.
141
142
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.
0 commit comments