diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-21 16:16:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-21 16:16:13 +0400 |
commit | f25618f29a65277039a11c021981dab487b96966 (patch) | |
tree | 77afa4c87f0b6e53694c490c9fbea5c30dfe71b5 /release/scripts | |
parent | 915f78af928d4ec0ec8cae5bca2710acee5cf3ea (diff) |
make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
removed RNAMeta mixin class since you cant register subclasses.
also some minor code cleanup
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index a32feda5d0c..11e1115fa4c 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -484,6 +484,15 @@ class Text(bpy_types.ID): if cont.type == 'PYTHON'] ) +class NodeSocket(StructRNA): # , metaclass=RNAMeta + __slots__ = () + + @property + def links(self): + """List of node links from or to this socket""" + return tuple(link for link in self.id_data.links if link.from_socket == self or link.to_socket == self) + + # values are module: [(cls, path, line), ...] TypeMap = {} @@ -717,12 +726,3 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): self.path_menu(bpy.utils.preset_paths(self.preset_subdir), self.preset_operator, filter_ext=lambda ext: ext.lower() in {".py", ".xml"}) - - -class NodeSocket(StructRNA, metaclass=RNAMeta): - __slots__ = () - - @property - def links(self): - """List of node links from or to this socket""" - return [link for link in self.id_data.links if link.from_socket == self or link.to_socket == self] |