import pfpy # Import the compound node functions. def pfNodeName(): # Essential function - defines the name of the compond node as it appears in the app. return 'Simple solve' def pfCreateNode(cnode): # Essential function to create the compond node: cnode.addNode('match', 'Auto Match') # Add an Auto Match node called 'match' cnode.addNode('solve', 'Camera Solver') # Add a Camera Solver node called 'solve' cnode.connectNodes('input', 'match') # The input of the compound node is wired to the input of the match node cnode.connectNodes('match', 'solve') # The output of the match node is connected to the input of the solve node cnode.connectNodes('solve', 'output') # The output of the solve node forms the output of the compound node def pfCreateGUI(cnode, gui): # Optional function to define the interface of the compond node: gui.addButton('matchButton', 'Match') # Add a button labelled 'Match' called 'matchButton' gui.addButton('solveButton', 'Solve') # Add a button labelled 'Solve' called 'solveButton' gui.addButton('bothButton', 'Match+Solve') # Add a button labelled 'Match+Solve' called 'bothButton' def pfGUIActivated(cnode, gui, widget, value): # Optional function to define the behaviour of the compond node interface: if widget == 'matchButton': # When the 'Match' button is pressed, call the autoMatch() method of the match node match= cnode.getNode('match') match.autoMatch() elif widget == 'solveButton': # When the 'Solve' button is pressed, call the solveAll() method of the solve node solve= cnode.getNode('solve') solve.solveAll() elif widget == 'bothButton': # When the 'Match+Solve' button is pressed, call both methods above match= cnode.getNode('match') match.autoMatch() solve= cnode.getNode('solve') solve.solveAll()