quickPrototype

<< Click to Display Table of Contents >>

Navigation:  Nodes > Tasks > Python Templates >

quickPrototype

 

Purpose

 

A  Python node with definable connectors, to be used as a template for creating python nodes.

 

Inputs

 

Any number of user defined inputs, with their names defined in the inputs property.

 

Outputs

 

Any number of user defined outputs, with their names defined in the outputs property.

 

 

Standard properties

Object Name

Color

 

Python standard properties

code

 

 

Node specific properties

 

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()

 

 

Additional documentation:

 

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

 

 

 

Developer reference (Python - quickPrototype.[Property ID], API Rest - node/quickPrototype/property/[Property ID])

 

Property Label

Property ID

Inputs

inputs

Outputs

outputs