[Bf-blender-cvs] [3736dabd934] master: Fix running space_node directly

Campbell Barton noreply at git.blender.org
Mon Aug 12 15:01:53 CEST 2019


Commit: 3736dabd93418e44f2bf715d91df746525d81948
Author: Campbell Barton
Date:   Mon Aug 12 22:52:43 2019 +1000
Branches: master
https://developer.blender.org/rB3736dabd93418e44f2bf715d91df746525d81948

Fix running space_node directly

Part of T65393

===================================================================

M	release/scripts/startup/bl_ui/space_node.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 939102bc11b..0f926e596de 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -676,7 +676,12 @@ def node_draw_tree_view(_layout, _context):
 # Adapt properties editor panel to display in node editor. We have to
 # copy the class rather than inherit due to the way bpy registration works.
 def node_panel(cls):
-    node_cls = type('NODE_' + cls.__name__, cls.__bases__, dict(cls.__dict__))
+    node_cls_dict = cls.__dict__.copy()
+
+    # Needed for re-registration.
+    node_cls_dict.pop("bl_rna", None)
+
+    node_cls = type('NODE_' + cls.__name__, cls.__bases__, node_cls_dict)
 
     node_cls.bl_space_type = 'NODE_EDITOR'
     node_cls.bl_region_type = 'UI'



More information about the Bf-blender-cvs mailing list