The Script SOP runs a python script each time the Script SOP cooks. It can create, delete and modify points, primitives and their vertices. It can create custom attributes or built-in attributes like
N (normals). It can add polygons, bezier curves and meshes among others. It can combine multiple inputs. By default, the Script SOP is created with a docked DAT that contains three Python methods:
cook() method is run each time the Script SOP cooks. The
setupParameters() method is run whenever the Setup Parameter button on the Script page is pressed. The
onPulse() method is run whenever a custom pulse parameter is pushed.
Refer to Help -> Python Examples, and Help -> Operator Snippets.
Note: Every time that a Script OP runs it will make a list of operators, parameters, nodes etc that it depends upon, and when they change, the Script OP will re-cook.
Parameters - Script Page
callbacks - Specifies the DAT which holds the callbacks. See scriptSOP_Class for usage.
setuppars - Clicking the button runs the
setupParameters() callback function.
These functions are included in the default script located in the docked node
# me is this DAT. # scriptOP is the OP which is cooking. # press 'Setup Parameters' in the OP to call this function to re-create the parameters. def setupParameters(scriptOP): scriptOP.appendParFloat('ValueA', page='Custom') scriptOP.appendParFloat('ValueB', page='Custom') return #called whenever custom pulse parameter is pushed def onPulse(par): return def cook(scriptOP): scriptOP.clear() return
- Input 0 -