forked from aws-deadline/deadline-cloud-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
134 lines (128 loc) · 3.59 KB
/
Copy pathtemplate.yaml
File metadata and controls
134 lines (128 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
specificationVersion: 'jobtemplate-2023-09'
name: KeyShot Standalone
description: |
A simple job bundle that allows the user to select a KeyShot scene file, the
frames to render, the output file path and render via the keyshot_headless
command on Windows.
parameterDefinitions:
# KeyShot Scene Settings
- name: KeyShotFile
description: The KeyShot scene file to render.
type: PATH
objectType: FILE
dataFlow: IN
userInterface:
control: CHOOSE_INPUT_FILE
label: KeyShot Scene File
groupLabel: KeyShot Scene Settings
fileFilters:
- label: KeyShot Scene Files
patterns:
- '*.bip'
- label: All Files
patterns:
- '*'
- name: Frames
description: The frames to render. E.g. 1-3,8,11-15
type: STRING
userInterface:
control: LINE_EDIT
label: Frames
groupLabel: KeyShot Scene Settings
minLength: 1
# KeyShot Output Settings
- name: OutputName
description: The file name prefix to save out each frame with
type: STRING
userInterface:
control: LINE_EDIT
label: Output File Name
groupLabel: KeyShot Output Settings
default: KeyShotOutput
- name: OutputDirectoryPath
description: The render output directory
type: PATH
objectType: DIRECTORY
dataFlow: OUT
userInterface:
control: CHOOSE_DIRECTORY
label: Output Directory Path
groupLabel: KeyShot Output Settings
- name: OutputFormat
description: The render output format
type: STRING
allowedValues:
[
"PNG",
"JPEG",
"EXR",
"TIFF8",
"TIFF32",
"PSD8",
"PSD16",
"PSD32"
]
default: PNG
userInterface:
control: DROPDOWN_LIST
label: Output Format
groupLabel: KeyShot Output Settings
# Software Environment
- name: CondaPackages
type: STRING
userInterface:
# This parameter is for a queue environment, not used directly in the job,
# so leave the GUI for the queue environment to display.
control: HIDDEN
default: keyshot
description: >
If you have a Queue Environment that creates a Conda environment from a parameter called CondaPackages, this
will set the default packages to use for the job.
steps:
- name: Render
parameterSpace:
taskParameterDefinitions:
- name: Frame
type: INT
range: "{{Param.Frames}}"
script:
actions:
onRun:
command: keyshot_headless
args:
- -progress
- -floating_feature
- keyshot2
- '{{Param.KeyShotFile}}'
- -script
- '{{Task.File.KeyShotScript}}'
embeddedFiles:
- name: KeyShotScript
filename: KeyShotScript.py
type: TEXT
data: |
match "{{Param.OutputFormat}}":
case "JPEG":
extension = ".jpg"
case "EXR":
extension = ".exr"
case "TIFF8" | "TIFF32":
extension = ".tif"
case "PSD8" | "PSD16" | "PSD32":
extension = ".psd"
case _:
extension = ".png"
opts = lux.getRenderOptions()
opts.setAddToQueue(False)
lux.setAnimationFrame(int("{{Task.Param.Frame}}"))
output_path = os.path.join(r"{{Param.OutputDirectoryPath}}", "{{Param.OutputName}}.{{Task.Param.Frame}}" + extension)
output_format_code = lux.RENDER_OUTPUT_{{Param.OutputFormat}}
print(f"Output Path: {output_path}")
print(f"Output Format: {output_format_code}")
lux.renderImage(path=output_path, opts=opts, format=output_format_code)
print("Finished Rendering")
hostRequirements:
attributes:
- name: attr.worker.os.family
anyOf:
- windows