Skip to content

Instantly share code, notes, and snippets.

@AndresMWeber
Last active October 5, 2017 20:50
Show Gist options
  • Save AndresMWeber/1c8959efa5cdb480208f0b5b01574d85 to your computer and use it in GitHub Desktop.
Save AndresMWeber/1c8959efa5cdb480208f0b5b01574d85 to your computer and use it in GitHub Desktop.
node registration
import sys
from joint import Joint
from transform import Transform
from unicode_delegate import UnicodeDelegate
from dag_node import DagNode
from curve import Curve
REGISTERED_NODES = {}
def register_node(node_class):
#setattr(sys.modules[__name__], node_class.__name__, node_class)
REGISTERED_NODES[node_class.__name__] = node_class
return node_class
import unittest
class TestNodeTypes(unittest.TestCase):
def test_imported_nodes(self):
import node_types
for registered_node_name in REGISTERED_NODES.keys():
self.assertTrue(hasattr(node_types, registered_node_name))
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment