Declarations
Each one is a field in the submitter and the value, from a single line. In a plugin, these are what generate the operator’s UI automatically. Every declaration takeslabel (what the submitter shows), required and show_if, and all of them except rf.sequence take a default.
One rule the module enforces by raising at import: one output per script. A second is a mistake worth finding immediately rather than at dispatch.
show_if hides a field until another holds a value: rf.text("codec", show_if={"encode": True}).
output
extensions, the submitter’s browse button becomes the operating system’s save dialog offering those types, the value is a file path, and the extension you get reads back as rf.paths.format. Without extensions the output is a folder.
rf.paths.output carries the value, which is how a handler downstream knows where the job wrote.
sequence
rf.path(). A browsed shot.####.exr gives every frame of its range. A step’s output gives the files that step wrote, filled in when the task starts. Before that, in @rf.submit and @rf.tasks, the list is empty, because the step it reads has not run yet.
A file in the list that does not exist, such as a frame the earlier step failed to write, is still in the list. Check with os.path.isfile() before reading it.
Hooks
Planning the tasks
@rf.tasks is what turns one script into many. It returns a list, and every entry becomes one task:
@rf.execute(item) exactly as it left, so a task can be a frame, a file, or a whole description of what that one machine should do. Two helpers cover the ordinary cases:
It runs on the machine that is submitting, because the farm needs the list before it can make anything. Raising stops the submission with your message; returning an empty list is refused, since a job with no tasks never finishes. Without
@rf.tasks, a script runs once on one machine.
Distributing the work
Called on the decorated@rf.execute function, to say how its calls should be spread:
Call none of these and the farm decides, which is one task per planned entry.
Context
Attribute access over what the task was given.rf.step[...] raises KeyError for a name the job does not have, which is the right answer when a script is wired to a step that has since been renamed.
Resolving
path picks which of an application’s binaries to resolve: rf.app("cinema4d", path="cmd") returns Cinema 4D’s Commandline build rather than its exe interface build.
Reporting
Failures
The difference between the first two is the whole of the retry behaviour.
Fatal is the script saying the work is wrong; AppNotFound is the script saying the machine is wrong.