Skip to main content
A Python step runs a script on a render machine, the same way a Shell step does. The difference is what it has access to: instead of reading RF_* environment variables, a Python step imports renderflow and reads the same facts as ordinary Python objects, plus a few conveniences a shell script does not get: a progress bar, a log level, and a clean way to fail with a sentence instead of a traceback.

Adding one

1

Add the step

Press the + button at the end of the chain and pick Python.
2

Give it a script

Either press Browse file and pick a .py file off disk, or press Type and write it in the editor.
3

Add arguments, if it takes any

The Arguments field becomes sys.argv for your script, the same as a Shell step’s Arguments field.

Reading the job

This is the Python form of what a Shell step reads from RF_JOB_NAME, RF_TASK_INDEX and the rest: the same facts, as attributes instead of environment variables.

Reusing another step’s output

Addressing a step by name is usually what you want, because a script wired to another step is written against what that step is, not where it happens to sit in the chain.

Paths across machines

A Windows workstation submits P:/shots/010. A Linux node mounts the same folder at /mnt/shots/010. rf.path() returns the form this machine uses, through the farm’s mapping table, so use it on any path: a step’s input or output, an argument, or one you built yourself.

Saying how it is going

Plain print() reaches the log too; rf.log only adds a level tag. rf.fatal (or raising rf.Fatal) is how a script ends itself on purpose: the operator reads your sentence rather than a traceback.

Example

How a Python step ends

rf.Fatal and an uncaught exception both end the script with exit code 1, and the difference is what the operator reads: Fatal shows your sentence, an uncaught exception shows a traceback.

Which Python runs it

The step runs the Python installed on the machine that takes the task. To ask for a particular version, pick it in the step’s Requirements and choose under Match how closely a machine’s Python has to agree with it.

When a step needs more

A Python step can also divide itself into tasks across machines, declare its own fields in the submitter, and ask for specific software before a machine is given the work. That is the same script with a name, an icon and a manifest: see Plugins.