Tips
use yml file
we usually use .yml file to write config.
that will much easier to write it.
yml file
info: {}
data:
some_tasks:
- step: pre
tasks:
- name: task1
module: somewhere.set_frame
- name: render
module: somewhere.render
comment: use new value from pre task
data_key_replace:
start: context.new_min
end: context.new_max
info, config = pz_config.read(yml_path)
data = {}
puzzle = Puzzle()
puzzle.play(config["some_tasks"], data)
is loop?
In Puzzle system, whether tasks go through a loop or not depends on the data type.
If the data type is a list, it will go through a loop.
If the data type is a dictionary, it will only go through once.
A step refers to a sequential stage in your pipeline.
It is simply a name you give to indicate what the tasks under that stage represent or achieve.
Looking at an example can help us understand better.
config
export_scene_tasks:
- step: pre
tasks:
- name: open file
module: somewhere.open_file
- name: export camera
module: somewhere.export_camera
conditions:
asset_type: camera
- step: main
comment: add export file info to context.
tasks:
- name: export ch assets
comment: append info to context
module: somewhere.export_ch
data_key_replace:
export_path: local_export_path
conditions:
asset_type: ch
- name: export prop assets
comment: append info to context
module: somewhere.export_prop
data_key_replace:
export_path: local_export_path
conditions:
asset_type: prop
- name: export bg assets
comment: append info to context
module: somewhere.export_bg
data_key_replace:
export_path: local_export_path
conditions:
asset_type: bg
- name: copy to server
comment: copy export path to server
module: somewhere.copy_to
data_key_replace:
src_path: local_export_path
dst_path: server_export_path
- step: post
tasks:
- name: integrations to shotgrid
module: somewhere.send_to_sg
data_key_replace:
export_files: context.export_files
data
data = {
"pre": {
"camera_name": "cam1",
"file": "xxxxx.ma"
},
"main": [
{"name": "charaA", "asset_type": "ch", "local_export_path": "local path", "server_export_path": "server"},
{"name": "charaB", "asset_type": "ch", "local_export_path": "local path", "server_export_path": "server"},
{"name": "propA", "asset_type": "prop", "local_export_path": "local path", "server_export_path": "server"},
{"name": "bg", "asset_type": "bg", "local_export_path": "local path", "server_export_path": "server"}
],
"post": {
}
}
Houdini hython override
If the default Program Files lookup doesn’t find Houdini’s hython.exe, set an explicit path via the environment variable PUZZLE_HYTHON_PATH.
- Example (PowerShell):
$env:PUZZLE_HYTHON_PATH = 'C:/SideFX/Houdini 20.0.653/bin/hython.exe' - Or use the DCC harness option
--program-directoryto point at the SideFX install root.