Python OperatorBasic Node Parameter
This Node lets you combine a Python script with an XPresso Expression. You can add any number of Input Ports with individual names via the context menu. However, the data type active in the Input Port cannot be subsequently changed with in the Python script. Hence, if you selected the wrong data type you have to delete the Port by double-clicking on it and create a new Input Port with the correct data type. All Input Ports are displayed within the Python script with their individual names as defined variables. This can be clearly seen in the Python Node’s standard Python script. This is where the Input Ports Input1 and Input2 are used without previously being defined in the script. The same applies to the Node’s Output Ports: they can be named individually and additional Ports with different data types can be added.
There are some limitations with regard to what Python does within a Python Node. Python Nodes are not allowed to directly access the Cinema 4D project document or objects in the scene via Python. If, for example, you want to ascertain an object’s current position within Python you can use XPresso Nodes to do this and pass this information via Ports to Python.
The Python Node is better suited for processing mathematical calculations and simple program structures, e.g., if-then-else. More complex Python applications should be executed via Python scripts in the Python Script Manager.