Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 19:40:40 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 19:40:40 +0400
commitbfa97b471065868657b98655806daa653e33df95 (patch)
tree533fbfa7dac019bf4840327e20ba4dd176887ca7 /release
parent6fe753c11b388da24254af3a562077d8f10901e1 (diff)
Workaround for C nodes: In order to make registerable RNA methods of the standard C nodes (e.g. poll or draw_buttons) available in python scripts, they need a specialized Node subtype (called NodeInternal). This is necessary because bpy omits any registerable functions of RNA types in the generated python classes, relying instead on using the supposed native implementation in a registered python class. Since the standard shader/compositor/texture nodes in Blender are not registered but directly created in makesrna they lack all registerable function in the associated python types. The NodeInternal RNA subtype replaces the registerable functions of the base Node type to solve this issue.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_types.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 55ba82c5817..204a9bcd261 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -853,6 +853,10 @@ class Node(StructRNA, metaclass=RNAMetaNode):
return True
+class NodeInternal(Node):
+ __slots__ = ()
+
+
class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):
__slots__ = ()
@@ -869,7 +873,7 @@ class NodeSocketInterface(StructRNA, metaclass=RNAMetaPropGroup):
# These are intermediate subclasses, need a bpy type too
-class CompositorNode(Node):
+class CompositorNode(NodeInternal):
__slots__ = ()
@classmethod
@@ -880,7 +884,7 @@ class CompositorNode(Node):
self.tag_need_exec()
-class ShaderNode(Node):
+class ShaderNode(NodeInternal):
__slots__ = ()
@classmethod
@@ -888,7 +892,7 @@ class ShaderNode(Node):
return ntree.bl_idname == 'ShaderNodeTree'
-class TextureNode(Node):
+class TextureNode(NodeInternal):
__slots__ = ()
@classmethod