Docs
Download

Python

Write the parts that are easier in code, from one line to whole scripts.

Nodes cover the structure of an add-on. When a step is quicker to write as code, these nodes put Python into the flow: a line typed on the node, or a script from a text block or a .py file. They're in Add › Python.

A Python Expression with the inputs obj and factor, and a Python Statement hiding the object, in an operator

Node
Python ExpressionA value from one line of Python. Names the line doesn't define become inputs
Python StatementRuns a line of Python in a flow
Get AttributeReads an attribute whose name is only known when the add-on runs
Set AttributeSets an attribute by its name
Inline ScriptRuns the code of a text block or a file where it is in the flow
Script FunctionCalls a function of one of the add-on's scripts

Which one to use:

  • One line: Python Expression for a value, Python Statement for an action.
  • A few lines in one place, like the body of an operator: Inline Script.
  • Code you want to reuse, or classes and handlers of your own: a script in the Files list, called with Script Function. See Scripts.