|
<< Click to Display Table of Contents >> Navigation: Nodes > Tasks > Python Templates > quickPrototype |
A Python node with definable connectors, to be used as a template for creating python nodes.
Any number of user defined inputs, with their names defined in the inputs property.
Any number of user defined outputs, with their names defined in the outputs property.
inputs, outputs: Comma separated list of input / output connectors to be created.
Code: The Python code that this node will execute.
from Mistika.Qt import QColor
from Mistika.classes import Cconnector
def init(self):
self.color=QColor(0x677688)
# creating properties
self.addProperty("inputs","input0, input1, input2")
self.addProperty("outputs","output0, output1, output2")
#creating connectors
inputList=self.inputs.split(",")
for inputCase in inputList:
self.addConnector(inputCase.strip(),Cconnector.CONNECTOR_TYPE_INPUT,Cconnector.MODE_OPTIONAL)
outputList=self.outputs.split(",")
for outputCase in outputList:
self.addConnector(outputCase.strip(),Cconnector.CONNECTOR_TYPE_OUTPUT,Cconnector.MODE_OPTIONAL)
#configuring the node
self.bypassSupported=True
self.color=QColor(0,180,180)
return True
def isReady(self):
#Always ready to prototype!
return True
def process(self):
#No process just WOW
return True
def onPropertyUpdated(self,name):
if name=="inputs":
self.rebuild()
if name=="outputs":
self.rebuild()
An introduction to all the Python tools in Mistika Workflows is available in the Python scripting tools section.
Information about library extension is available in the Mistika Python Extension Library
Property Label |
Property ID |
Inputs |
inputs |
Outputs |
outputs |