diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-09 15:35:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-09 15:56:58 +0300 |
commit | 11a9434c2deed4f560f1c7381faf697f77b9de5c (patch) | |
tree | 2aed583aaa97d87234b72a83b11dc38a2569b388 /release | |
parent | 3c3d0898b0c1a1d7da70f4a1778d4360b3cfe5c8 (diff) |
Resolve T52687: Add node label shows as 'Unknown'
Add type access method, need to extend to other types
for now just get node UI working properly again.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/nodeitems_utils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/release/scripts/modules/nodeitems_utils.py b/release/scripts/modules/nodeitems_utils.py index 7dc456f6c98..117e35dd028 100644 --- a/release/scripts/modules/nodeitems_utils.py +++ b/release/scripts/modules/nodeitems_utils.py @@ -59,9 +59,9 @@ class NodeItem: return self._label else: # if no custom label is defined, fall back to the node type UI name - cls = bpy.types.Node.bl_rna_get_subclass(self.nodetype) - if cls is not None: - return cls.bl_rna.name + bl_rna = bpy.types.Node.bl_rna_get_subclass(self.nodetype) + if bl_rna is not None: + return bl_rna.name else: return "Unknown" @@ -71,9 +71,9 @@ class NodeItem: return bpy.app.translations.contexts.default else: # if no custom label is defined, fall back to the node type UI name - cls = bpy.types.Node.bl_rna_get_subclass(self.nodetype) - if cls is not None: - return cls.bl_rna.translation_context + bl_rna = bpy.types.Node.bl_rna_get_subclass(self.nodetype) + if bl_rna is not None: + return bl_rna.translation_context else: return bpy.app.translations.contexts.default |