diff --git a/NodeGraphQt/__init__.py b/NodeGraphQt/__init__.py index aa004d71..ba7ba753 100644 --- a/NodeGraphQt/__init__.py +++ b/NodeGraphQt/__init__.py @@ -30,45 +30,47 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -NodeGraphQt is a node graph framework that can be implemented and re purposed -into applications that supports PySide2. +**NodeGraphQt** is a node graph framework that can be implemented and re purposed +into applications that supports **PySide2**. -url: https://github.com/jchanvfx/NodeGraphQt -docs: http://chantasticvfx.com/nodeGraphQt/html/index.html +project: https://github.com/jchanvfx/NodeGraphQt -Basic Example: +example code: -import sys -from NodeGraphQt import QtWidgets, NodeGraph, BaseNode +.. code-block:: python + :linenos: + import sys + from NodeGraphQt import QtWidgets, NodeGraph, BaseNode -class MyNode(BaseNode): - __identifier__ = 'com.chantasticvfx' - NODE_NAME = 'My Node' + class MyNode(BaseNode): - def __init__(self): - super(MyNode, self).__init__() - self.add_input('foo', color=(180, 80, 0)) - self.add_output('bar') + __identifier__ = 'com.chantasticvfx' + NODE_NAME = 'My Node' -if __name__ == '__main__': - app = QtWidgets.QApplication(sys.argv) - graph = NodeGraph() + def __init__(self): + super(MyNode, self).__init__() + self.add_input('foo', color=(180, 80, 0)) + self.add_output('bar') - graph.register_node(BaseNode) - graph.register_node(BackdropNode) + if __name__ == '__main__': + app = QtWidgets.QApplication(sys.argv) + graph = NodeGraph() - backdrop = graph.create_node('nodeGraphQt.nodes.Backdrop', name='Backdrop') - node_a = graph.create_node('com.chantasticvfx.MyNode', name='Node A') - node_b = graph.create_node('com.chantasticvfx.MyNode', name='Node B', color='#5b162f') + graph.register_node(BaseNode) + graph.register_node(BackdropNode) - node_a.set_input(0, node_b.output(0)) + backdrop = graph.create_node('nodeGraphQt.nodes.Backdrop', name='Backdrop') + node_a = graph.create_node('com.chantasticvfx.MyNode', name='Node A') + node_b = graph.create_node('com.chantasticvfx.MyNode', name='Node B', color='#5b162f') - viewer = graph.viewer() - viewer.show() + node_a.set_input(0, node_b.output(0)) - app.exec_() + viewer = graph.viewer() + viewer.show() + + app.exec_() """ try: diff --git a/NodeGraphQt/base/graph.py b/NodeGraphQt/base/graph.py index ba406d98..1d32d738 100644 --- a/NodeGraphQt/base/graph.py +++ b/NodeGraphQt/base/graph.py @@ -26,28 +26,68 @@ class NodeGraph(QtCore.QObject): """ The ``NodeGraph`` class is the main controller for managing all nodes. - Inherited from: ``PySide2.QtCore.QObject`` + Inherited from: :class:`PySide2.QtCore.QObject` .. image:: _images/graph.png :width: 60% """ - #:QtCore.Signal: emits the node object when a node is created in the node graph. node_created = QtCore.Signal(NodeObject) - #:QtCore.Signal: emits a ``list[str]`` of node ids from the deleted nodes. + """ + Signal triggered when a node is created in the node graph. + + :parameters: :class:`NodeGraphQt.NodeObject` + :emits: created node + """ nodes_deleted = QtCore.Signal(list) - #:QtCore.Signal: emits the node object when selected in the node graph. + """ + Signal triggered when nodes have been deleted from the node graph. + + :parameters: list[str] + :emits: list of deleted node ids. + """ node_selected = QtCore.Signal(NodeObject) - #:QtCore.Signal: triggered when a node is double clicked and emits the node. + """ + Signal triggered when a node is clicked with the LMB. + + :parameters: :class:`NodeGraphQt.NodeObject` + :emits: selected node + """ node_double_clicked = QtCore.Signal(NodeObject) - #:QtCore.Signal: for when a node has been connected emits (``input port``, ``output port``). + """ + Signal triggered when a node is double clicked and emits the node. + + :parameters: :class:`NodeGraphQt.NodeObject` + :emits: selected node + """ port_connected = QtCore.Signal(Port, Port) - #:QtCore.Signal: for when a node has been disconnected emits (``input port``, ``output port``). + """ + Signal triggered when a node port has been connected. + + :parameters: :class:`NodeGraphQt.Port`, :class:`NodeGraphQt.Port` + :emits: input port, output port + """ port_disconnected = QtCore.Signal(Port, Port) - #:QtCore.Signal: for when a node property has changed emits (``node``, ``property name``, ``property value``). + """ + Signal triggered when a node port has been disconnected. + + :parameters: :class:`NodeGraphQt.Port`, :class:`NodeGraphQt.Port` + :emits: input port, output port + """ property_changed = QtCore.Signal(NodeObject, str, object) - #:QtCore.Signal: for when drop data has been added to the graph. + """ + Signal is triggered when a property has changed on a node. + + :parameters: :class:`NodeGraphQt.BaseNode`, str, object + :emits: triggered node, property name, property value + """ data_dropped = QtCore.Signal(QtCore.QMimeData, QtCore.QPoint) + """ + Signal is triggered when data has been dropped to the graph. + + :parameters: :class:`PySide2.QtCore.QMimeData`, :class:`PySide2.QtCore.QPoint` + :emits: mime data, node graph position + """ def __init__(self, parent=None): super(NodeGraph, self).__init__(parent) @@ -237,7 +277,7 @@ def widget(self): The node graph widget for adding into a layout. Returns: - QtWidgets.QWidget: node graph widget. + PySide2.QtWidgets.QWidget: node graph widget. """ if self._widget is None: self._widget = QtWidgets.QWidget() @@ -249,16 +289,16 @@ def widget(self): def show(self): """ Show node graph widget this is just a convenience - function to :meth:`NodeGraph.widget().show()`. + function to :meth:`NodeGraph.widget.show()`. """ - self._widget.show() + self.widget.show() def close(self): """ Close node graph NodeViewer widget this is just a convenience - function to :meth:`NodeGraph.widget().close()`. + function to :meth:`NodeGraph.widget.close()`. """ - self._widget.close() + self.widget.close() def viewer(self): """ @@ -270,7 +310,7 @@ def viewer(self): See Also: :attr:`NodeGraph.widget` for adding the node graph into a - QtWidgets.QLayout. + :class:`PySide2.QtWidgets.QLayout`. Returns: NodeGraphQt.widgets.viewer.NodeViewer: viewer interface. @@ -429,7 +469,7 @@ def get_context_menu(self, menu): menu (str): menu name. Returns: - NodeGraphMenu or NodesMenu: context menu object. + NodeGraphQt.NodeGraphMenu or NodeGraphQt.NodesMenu: context menu object. """ menus = self._viewer.context_menus() if menus.get(menu): diff --git a/NodeGraphQt/base/menu.py b/NodeGraphQt/base/menu.py index 58ee0b0b..ac437aab 100644 --- a/NodeGraphQt/base/menu.py +++ b/NodeGraphQt/base/menu.py @@ -8,7 +8,7 @@ class NodeGraphMenu(object): """ - The ``NodeGraphMenu`` is the context menu triggered from the node graph. + The ``NodeGraphMenu`` is the main context menu triggered from the node graph. example for accessing the node graph context menu. @@ -22,8 +22,6 @@ class NodeGraphMenu(object): # get the context menu for the node graph. context_menu = node_graph.get_context_menu('graph') - print(context_menu) - # >> """ def __init__(self, graph, qmenu): @@ -124,7 +122,7 @@ def add_command(self, name, func=None, shortcut=None): shortcut (str): shotcut key. Returns: - NodeGraphQt.MenuCommand: the appended command. + NodeGraphQt.NodeGraphCommand: the appended command. """ action = GraphAction(name, self._graph.viewer()) action.graph = self._graph @@ -146,45 +144,21 @@ def add_separator(self): class NodesMenu(NodeGraphMenu): """ - The ``NodesMenu`` is the context menu triggered from the nodes. + The ``NodesMenu`` is the context menu triggered from a node. **Inherited from:** :class:`NodeGraphQt.NodeGraphMenu` - example for adding a command to the nodes context menu. + example for accessing the nodes context menu. .. code-block:: python :linenos: - from NodeGraphQt import BaseNode, NodeGraph - - # example node. - class MyNode(BaseNode): - - __identifier__ = 'com.chantasticvfx' - NODE_NAME = 'my node' - - def __init__(self): - super(MyNode, self).__init__() - self.add_input('in') - self.add_output('out') + from NodeGraphQt import NodeGraph - # create node graph. node_graph = NodeGraph() - # register example node. - node_graph.register_node(MyNode) - - # get the context menu for the nodes. + # get the nodes context menu. nodes_menu = node_graph.get_context_menu('nodes') - - # create a command - def test_func(graph, node): - print('Clicked on node: {}'.format(node.name())) - - nodes_menu.add_command('test', - func=test_func, - node_type='com.chantasticvfx.MyNode') - """ def add_command(self, name, func=None, node_type=None): @@ -197,7 +171,7 @@ def add_command(self, name, func=None, node_type=None): node_type (str): specified node type for the command. Returns: - NodeGraphQt.MenuCommand: the appended command. + NodeGraphQt.NodeGraphCommand: the appended command. """ if not node_type: raise NodeMenuError('Node type not specified!') @@ -239,7 +213,7 @@ def qaction(self): The underlying qaction. Returns: - BaseAction: qaction object. + GraphAction: qaction object. """ return self._qaction diff --git a/NodeGraphQt/base/node.py b/NodeGraphQt/base/node.py index 22509444..b8a8114c 100644 --- a/NodeGraphQt/base/node.py +++ b/NodeGraphQt/base/node.py @@ -36,10 +36,10 @@ class NodeObject(object): qgraphics_item (AbstractNodeItem): graphic item used for drawing. """ - #:str: unique node identifier domain. + # Unique node identifier domain. `eg.` ``"com.chantacticvfx"`` __identifier__ = 'nodeGraphQt.nodes' - #:str: base node name. + # Base node name. NODE_NAME = None def __init__(self, qgraphics_item=None): @@ -61,7 +61,7 @@ def __repr__(self): def type_(cls): """ Node type identifier followed by the class name. - eg. nodeGraphQt.nodes.MyNode + `eg.` ``"com.chantacticvfx.NodeObject"`` Returns: str: node type. diff --git a/NodeGraphQt/base/utils.py b/NodeGraphQt/base/utils.py index 2d384f64..bc677b0f 100644 --- a/NodeGraphQt/base/utils.py +++ b/NodeGraphQt/base/utils.py @@ -6,7 +6,9 @@ def setup_context_menu(graph): """ - Sets up the node graphs context menu with some basic menus and commands. + populate the specified graph's context menu with essential menus commands. + + example code: .. code-block:: python :linenos: @@ -16,6 +18,11 @@ def setup_context_menu(graph): graph = NodeGraph() setup_context_menu(graph) + result: + + .. image:: _images/menu_hotkeys.png + :width: 300px + Args: graph (NodeGraphQt.NodeGraph): node graph. """ diff --git a/docs/_images/selection.png b/docs/_images/selection.png new file mode 100644 index 00000000..de08904b Binary files /dev/null and b/docs/_images/selection.png differ diff --git a/docs/constants.rst b/docs/constants.rst index 8bdcb729..3c0b225d 100644 --- a/docs/constants.rst +++ b/docs/constants.rst @@ -4,4 +4,3 @@ Constants .. automodule:: NodeGraphQt.constants :members: :member-order: bysource - :noindex: diff --git a/docs/examples/ex_menu.rst b/docs/examples/ex_menu.rst new file mode 100644 index 00000000..717010e2 --- /dev/null +++ b/docs/examples/ex_menu.rst @@ -0,0 +1,100 @@ +Menu Examples +############# + +Examples for customizing context menus in NodeGraphQt. + +Default Menu Setup +****************** + +The NodeGraphQt module has a convenience function for setting up the node graph +with a few essential menu commands. + +`See function:` :func:`NodeGraphQt.setup_context_menu` + +.. image:: ../_images/menu_hotkeys.png + :width: 300px + +Adding to the Graph Menu +************************ + +The ``"graph"`` menu is the main context menu from the NodeGraph object, below +is an example where we add a ``"Foo"`` menu and then a ``"Bar"`` command with +the registered ``my_test()`` function. + +.. code-block:: python + :linenos: + + from NodeGraphQt import NodeGraph + + # test function. + def my_test(graph): + selected_nodes = graph.selected_nodes() + print('Number of nodes selected: {}'.format(len(selected_nodes))) + + # create node graph. + node_graph = NodeGraph() + + # get the main context menu. + context_menu = node_graph.get_context_menu('graph') + + # add a menu called "Foo". + foo_menu = context_menu.add_menu('Foo') + + # add "Bar" command to the "Foo" menu. + # we also assign a short cut key "Shift+t" for this example. + foo_menu.add_command('Bar', my_test, 'Shift+t') + +Adding to the Nodes Menu +************************ + +Aside from the main context menu, the NodeGraph also has a nodes menu where you +can override context menus on a per node type basis. + +Below is an example for overriding a context menu for the node type ``"com.chantasticvfx.FooNode"`` + +.. code-block:: python + :linenos: + + from NodeGraphQt import BaseNode, NodeGraph, setup_context_menu + + # define a couple example nodes. + class FooNode(BaseNode): + + __identifier__ = 'com.chantasticvfx' + NODE_NAME = 'foo node' + + def __init__(self): + super(FooNode, self).__init__() + self.add_input('in') + self.add_output('out') + + class BarNode(FooNode): + + NODE_NAME = 'bar node' + + # define a test function. + def test_func(graph, node): + print('Clicked on node: {}'.format(node.name())) + + # create node graph and register node classes. + node_graph = NodeGraph() + node_graph.register_node(FooNode) + node_graph.register_node(BarNode) + + # set up default menu commands. + setup_context_menu(node_graph) + + # get the nodes menu. + nodes_menu = node_graph.get_context_menu('nodes') + + # here we add override the context menu for "com.chantasticvfx.FooNode". + nodes_menu.add_command('Test', + func=test_func, + node_type='com.chantasticvfx.FooNode') + + # create some nodes. + foo_node = graph.create_node('com.chantasticvfx.FooNode') + bar_node = graph.create_node('com.chantasticvfx.BarNode', pos=[300, 100]) + + # show widget. + node_graph.widget.show() \ No newline at end of file diff --git a/docs/examples/ex_node.rst b/docs/examples/ex_node.rst new file mode 100644 index 00000000..e4cb6c72 --- /dev/null +++ b/docs/examples/ex_node.rst @@ -0,0 +1,139 @@ +Node Examples +############# + +Creating Nodes +************** + +| Creating is done simply by calling the :func:`NodeGraphQt.NodeGraph.create_node` function. +| (`see example below` ``line: 22``) + +.. code-block:: python + :linenos: + + from NodeGraphQt import BaseNode, NodeGraph, QtWidgets + + class MyNode(BaseNode): + + __identifier__ = 'com.chantasticvfx' + NODE_NAME = 'my node' + + def __init__(self): + super(MyNode, self).__init__() + self.add_input('foo') + self.add_input('hello') + self.add_output('bar') + self.add_output('world') + + if __name__ == '__main__': + app = QtWidgets.QApplication([]) + + node_graph = NodeGraph() + node_graph.register_node(MyNode) + node_graph.widget.show() + + # here we create a couple nodes in the node graph. + node_a = node_graph.create_node('com.chantasticvfx.MyNode', name='node a') + node_b = node_graph.create_node('com.chantasticvfx.MyNode', name='node b', pos=[300, 100]) + + app.exec_() + + +Connecting Nodes +**************** + +There a multiple ways for connecting node ports here are a few examples below. + +connecting nodes by the port index: + +.. code-block:: python + + node_b.set_input(0, node_a.output(0)) + +connect nodes by the port name: + +.. code-block:: python + + node_a.outputs()['bar'].connect_to(node_b.inputs()['foo']) + +connecting nodes with the port objects: + +.. code-block:: python + + # node_a "bar" output port. + port_a = node_a.output(0) + # node_b "foo" input port. + port_b = node_b.inputs()['foo'] + # make the connection. + port_a.connect_to(port_b) + +`more on ports and connections.` + + - :func:`NodeGraphQt.BaseNode.input` + - :func:`NodeGraphQt.BaseNode.output` + - :func:`NodeGraphQt.BaseNode.set_input` + - :func:`NodeGraphQt.BaseNode.set_output` + - :func:`NodeGraphQt.BaseNode.inputs` + - :func:`NodeGraphQt.BaseNode.outputs` + - :func:`NodeGraphQt.Port.connect_to` + - :func:`NodeGraphQt.Port.disconnect_from` + + +Widget Example +************** + +Here's an example where we subclass the ``NodeGraph`` and connect it up to a +``PropertiesBinWidget`` and have it show when a node is double clicked. + +.. code-block:: python + :linenos: + + from NodeGraphQt import BaseNode, NodeGraph, PropertiesBinWidget, QtCore, QtWidgets + + + class MyNode(BaseNode): + + __identifier__ = 'com.chantasticvfx' + NODE_NAME = 'my node' + + def __init__(self): + super(MyNode, self).__init__() + self.add_input('in') + self.add_output('out') + + + class MyNodeGraph(NodeGraph): + + def __init__(self, parent=None): + super(MyNodeGraph, self).__init__(parent) + + # properties bin widget. + self._prop_bin = PropertiesBinWidget(node_graph=self) + self._prop_bin.setWindowFlags(QtCore.Qt.Tool) + + # wire signal. + self.node_double_clicked.connect(self.display_prop_bin) + + def display_prop_bin(self, node): + """ + function for displaying the properties bin when a node + is double clicked + """ + if not self._prop_bin.isVisible(): + self._prop_bin.show() + + + if __name__ == '__main__': + app = QtWidgets.QApplication([]) + + node_graph = MyNodeGraph() + node_graph.register_node(MyNode) + node_graph.widget.show() + + node_a = node_graph.create_node('com.chantasticvfx.MyNode') + + app.exec_() + +`more on the properties bin and node_double_clicked signal` + + - :class:`NodeGraphQt.PropertiesBinWidget` + - :attr:`NodeGraphQt.NodeGraph.node_double_clicked` \ No newline at end of file diff --git a/docs/overview.rst b/docs/examples/ex_overview.rst similarity index 76% rename from docs/overview.rst rename to docs/examples/ex_overview.rst index aa173c31..79c9b0a6 100644 --- a/docs/overview.rst +++ b/docs/examples/ex_overview.rst @@ -1,9 +1,9 @@ -Overview -######## +NodeGraph Overview +################## -NodeGraphQt is a node graph framework that can be implemented and repurposed into applications that supports ``PySide2``. +User interface overview for the node graph. -.. image:: _images/overview.png +.. image:: ../_images/overview.png :width: 70% Navigation @@ -17,28 +17,21 @@ Navigation | Pan | *Alt + LMB + Drag* or *MMB + Drag* | +---------------+----------------------------------------------+ -Port Connections -**************** +Node Selection +************** -.. image:: _images/slicer.png - :width: 600px +.. image:: ../_images/selection.png + :width: 500px -Connection pipes can be disconnected easily with the built in slice tool. +Nodes can be selected/unselected with the selection marquee using LMB + Drag -+---------------------+----------------------------+ -| action | controls | -+=====================+============================+ -| Slice connections | *Alt + Shift + LMB + Drag* | -+---------------------+----------------------------+ - - -Node Search -*********** +Tab Search +********** -.. image:: _images/node_search.png +.. image:: ../_images/node_search.png :width: 269px -Node can be created with the tab node search widget. +Nodes registered in the node graph can be created with the tab search widget. +-------------------+--------+ | action | hotkey | @@ -46,16 +39,25 @@ Node can be created with the tab node search widget. | Toggle Visibility | *Tab* | +-------------------+--------+ +Pipe Slicing +************ -Example -******* +.. image:: ../_images/slicer.png + :width: 600px + +Connection pipes can be disconnected easily with the built in slice tool. + ++---------------------+----------------------------+ +| action | controls | ++=====================+============================+ +| Slice connections | *Alt + Shift + LMB + Drag* | ++---------------------+----------------------------+ -Here's a basic example for creating two nodes and connecting them together. -.. image:: _images/example_result.png - :width: 60% +Basic Example +************* -example code: +Here's a basic example snippet for creating two nodes and connecting them together. .. code-block:: python :linenos: @@ -66,6 +68,7 @@ example code: from NodeGraphQt import NodeGraph, BaseNode, setup_context_menu + # create a node class object inherited from BaseNode. class FooNode(BaseNode): # unique node identifier domain. @@ -108,3 +111,8 @@ example code: node_a.set_output(0, node_b.input(2)) app.exec_() + +result: + +.. image:: ../_images/example_result.png + :width: 60% \ No newline at end of file diff --git a/docs/graph.rst b/docs/graph.rst index dc224591..7959c535 100644 --- a/docs/graph.rst +++ b/docs/graph.rst @@ -1,11 +1,13 @@ NodeGraph ######### +`See` :ref:`Basic Example` `from the NodeGraph overview.` + +---- + .. autoclass:: NodeGraphQt.NodeGraph :members: :exclude-members: model, widget ----- - -.. autoattribute:: NodeGraphQt.NodeGraph.widget -.. autoattribute:: NodeGraphQt.NodeGraph.model + .. autoattribute:: NodeGraphQt.NodeGraph.widget + .. autoattribute:: NodeGraphQt.NodeGraph.model diff --git a/docs/index.rst b/docs/index.rst index b9ab4dbf..7d2446e8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,22 +1,31 @@ -NodeGraphQt -########### +NodeGraphQt API +############### -Welcome to the ``NodeGraphQt`` documentation. +Welcome to the NodeGraphQt documentation. .. image:: _images/screenshot.png :width: 95% -Project Repo: https://github.com/jchanvfx/NodeGraphQt +GitHub Project: https://github.com/jchanvfx/NodeGraphQt ---- .. toctree:: - :name: mastertoc - :maxdepth: 3 + :caption: Module Contents + :name: moduletoc + :maxdepth: 2 - overview constants graph nodes menu widgets + +.. toctree:: + :caption: Module Examples + :name: examplestoc + :maxdepth: 3 + + examples/ex_overview + examples/ex_node + examples/ex_menu diff --git a/docs/menu.rst b/docs/menu.rst index e0ca7463..115208d6 100644 --- a/docs/menu.rst +++ b/docs/menu.rst @@ -1,53 +1,24 @@ Menus ##### -.. image:: _images/menu_hotkeys.png - :width: 50% +.. currentmodule:: NodeGraphQt +Setup Context Menu +****************** -Here's an example where we add a ``"Foo"`` menu and then a ``"Bar"`` command with -the function ``my_test()`` registered. - -.. code-block:: python - :linenos: - - from NodeGraphQt import NodeGraph - - # test function. - def my_test(graph): - selected_nodes = graph.selected_nodes() - print('Number of nodes selected: {}'.format(len(selected_nodes))) - - # create node graph. - graph = NodeGraph() - - # get the main context menu. - context_menu = node_graph.get_context_menu('graph') - - # add a menu called "Foo". - foo_menu = context_menu.add_menu('Foo') - - # add "Bar" command to the "Foo" menu. - # we also assign a short cut key "Shift+t" for this example. - foo_menu.add_command('Bar', my_test, 'Shift+t') - ----- - -The ``NodeGraphQt.setup_context_menu`` is a built in function that'll populate -the node graphs context menu a few default menus and commands. - - -.. autofunction:: NodeGraphQt.setup_context_menu - :noindex: +The ``setup_context_menu`` is a convenience function that'll populate the main +context menu on node graph. +.. autofunction:: setup_context_menu Graph Menu ********** The context menu triggered from the node graph. -.. autoclass:: NodeGraphQt.NodeGraphMenu +.. autoclass:: NodeGraphMenu :members: + :exclude-members: qmenu Nodes Menu @@ -55,12 +26,13 @@ Nodes Menu The context menu triggered from a node. -.. autoclass:: NodeGraphQt.NodesMenu +.. autoclass:: NodesMenu :members: Command ******* -.. autoclass:: NodeGraphQt.NodeGraphCommand +.. autoclass:: NodeGraphCommand :members: + :exclude-members: qaction diff --git a/docs/nodes/NodeObject.rst b/docs/nodes/NodeObject.rst index eeb628a6..7ecb032a 100644 --- a/docs/nodes/NodeObject.rst +++ b/docs/nodes/NodeObject.rst @@ -5,12 +5,35 @@ NodeObject :members: :exclude-members: NODE_NAME, graph, id, model, type_, view ----- - -.. autoattribute:: NodeGraphQt.NodeObject.type_ -.. autoattribute:: NodeGraphQt.NodeObject.__identifier__ -.. autoattribute:: NodeGraphQt.NodeObject.NODE_NAME -.. autoattribute:: NodeGraphQt.NodeObject.graph -.. autoattribute:: NodeGraphQt.NodeObject.id -.. autoattribute:: NodeGraphQt.NodeObject.model -.. autoattribute:: NodeGraphQt.NodeObject.view + .. autoattribute:: NODE_NAME + :annotation: + + Initial base node name. + + .. note:: re-implement this attribute to provide a base node name. + + :return: node name + :rtype: str + + .. autoattribute:: __identifier__ + :annotation: + + Unique node identifier domain. eg. ``"com.chantacticvfx"`` + + .. note:: re-implement this attribute to provide a unique node type. + + :return: node identifer domain + :rtype: str + + .. autoattribute:: graph + .. autoattribute:: id + .. autoattribute:: model + .. autoattribute:: type_ + :annotation: + + Node type identifier followed by the class name. `eg.` ``"com.chantacticvfx.NodeObject"`` + + :return: node type (``__identifier__.__className__``) + :rtype: str + + .. autoattribute:: view diff --git a/docs/widgets.rst b/docs/widgets.rst index ab727ad8..32d76e61 100644 --- a/docs/widgets.rst +++ b/docs/widgets.rst @@ -2,8 +2,8 @@ Widgets ####### -PropertiesBinWidget -******************* +Properties Bin +************** The ``PropertiesBinWidget`` is a list widget for displaying and editing a nodes properties. @@ -31,8 +31,8 @@ example :members: :exclude-members: property_changed -NodeTreeWidget -************** +Nodes Tree +********** The ``NodeTreeWidget`` is a widget for displaying all registered nodes from the node graph with this widget a user can create nodes by dragging and dropping.