Skip to main content
The module a Python step and a plugin both import. Standard library only, and Python 3.8 syntax, because a render node runs it under whatever interpreter it resolved with nothing installed.

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 takes label (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

With 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

In the submitter the field is a list of the outputs the earlier steps in the job declare, and a browse button. Pick a step’s output, or browse to one frame of a sequence and RenderFlow finds the rest of it beside that frame. The script always reads a list of paths, already mapped for the machine it runs on with 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:
An entry is anything JSON can carry, and it reaches @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.

Exit codes

What the process leaves, and what the farm does with it:

Markers

The module writes these to standard output, and the service reads them. You never write them yourself, and they are here because they show up in a task log:

Seeing what a script declares

This is the one thing a script does when you run it yourself, and it is the same thing the service does when a plugin is installed: import the file, collect the declarations, print them. What the submitter will show is something you can read in a terminal before anyone installs anything. A script is not otherwise runnable as a program. It runs as a task, where the values, the node, its installed software and the farm’s path mapping are all bound before your code sees them. None of that exists in a terminal, so a local run could only ever prove that the file imports.