Skip to content

Node graph widget that can be reimplemented into applications that supports PySide2

License

Notifications You must be signed in to change notification settings

rigGitLikeYouDigGit/NodeGraphQt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeGraphQT

License: MIT PEP8 stability-wip

This is a personal project I'm working on in my spare time, as a learning exercise for writing a custom node graph.


NodeGraphQt is a node graph framework that can be implemented and repurposed into applications that supports PySide2.

screencap01

Requirements

  • Python 3
  • PySide2

Navigation Controls

action controls
Zoom in/out RMB + Drag or Mouse Scroll Up/Down
Pan MMB + Drag or Alt + LMB + Drag

Node Search

screencap03

action hotkey
Show node search Tab

Context Menu

screencap02

API Documentation

currently unavaliable

Example Code

import sys
from PySide2 import QtWidgets
from NodeGraphQt import NodeGraph, Node, Backdrop

# create a example node object with a input/output port.
class MyNode(Node):
    """example test node."""

    # unique node identifier.
    __identifier__ = 'com.chantasticvfx'

    # initial default node name.
    NODE_NAME = 'Test Node'

    def __init__(self):
        super(MyNode, self).__init__()
        self.add_input('foo')
        self.add_output('bar')


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)

    # create the main node graph controller.
    graph = NodeGraph()
   
    # register backdrop node. (included in the NodeGraphQt module)
    graph.register_node(Backdrop)
   
    # register example node into the node graph.
    graph.register_node(MyNode)
   
    # create nodes.
    backdrop = graph.create_node('nodeGraphQt.nodes.Backdrop', name='Backdrop')
    node_a = graph.create_node('com.chantasticvfx.MyNode', name='Foo Node')
    node_b = graph.create_node('com.chantasticvfx.MyNode', name='Bar Node', color='#5b162f')
    
    # connect nodes.
    node_a.set_input(0, node_b.output(0))    

    # show widget.
    viewer = graph.viewer()
    viewer.show()

    app.exec_()

About

Node graph widget that can be reimplemented into applications that supports PySide2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%