Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions NodeGraphQt/base/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,32 @@ class NodeFactory(object):

@property
def names(self):
"""
Return all currently registered node type identifiers.

Returns:
dict: key=<node name, value=node_type
"""
return self.__names

@property
def aliases(self):
"""
Return aliases assigned to the node types.

Returns:
dict: key=alias, value=node type
"""
return self.__aliases

@property
def nodes(self):
"""
Return all registered nodes.

Returns:
dict: key=node identifier, value=node class
"""
return self.__nodes

def create_node_instance(self, node_type=None, alias=None):
Expand Down
14 changes: 13 additions & 1 deletion NodeGraphQt/base/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,19 @@ def set_node_common_properties(self, attrs):
}
}
"""
self.__common_node_props.update(attrs)
for node_type in attrs.keys():
node_props = attrs[node_type]

if node_type not in self.__common_node_props.keys():
self.__common_node_props[node_type] = node_props
continue

for prop_name, prop_attrs in node_props.items():
common_props = self.__common_node_props[node_type]
if prop_name not in common_props.keys():
common_props[prop_name] = prop_attrs
continue
common_props[prop_name].update(prop_attrs)

def get_node_common_properties(self, node_type):
"""
Expand Down
4 changes: 2 additions & 2 deletions NodeGraphQt/base/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def create_property(self, name, value, items=None, range=None,
value (object): data.
items (list[str]): items used by widget type NODE_PROP_QCOMBO
range (tuple)): min, max values used by NODE_PROP_SLIDER
widget_type (int): widget type flag (not implemented yet).
tab (str): name of the widget tab to display in.
widget_type (int): widget flag to display in the properties bin.
tab (str): name of the widget tab to display in the properties bin.
"""
self.model.add_property(name, value, items, range, widget_type, tab)

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---

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

<img src="/docs/_images/screenshot.png" width="100%" title="NodeGraphQt">

Expand All @@ -30,7 +30,8 @@ http://chantasticvfx.com/nodeGraphQt/html/index.html

```python
import sys
from PySide2 import QtWidgets

from NodeGraphQt import QtWidgets
from NodeGraphQt import NodeGraph, Node, Backdrop, setup_context_menu

# create a example node object with a input/output port.
Expand Down
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ example code:
:linenos:

import sys
from PySide2 import QtWidgets

from NodeGraphQt import QtWidgets
from NodeGraphQt import NodeGraph, BaseNode, setup_context_menu


Expand Down