Merge branch 'master' into blender2.8

Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
This commit is contained in:
2017-06-29 10:11:17 +02:00
7 changed files with 40 additions and 20 deletions

View File

@@ -61,13 +61,19 @@ class NodeItem:
# if no custom label is defined, fall back to the node type UI name
return getattr(bpy.types, self.nodetype).bl_rna.name
@property
def translation_context(self):
if self._label:
return bpy.app.translations.contexts.default
else:
# if no custom label is defined, fall back to the node type UI name
return getattr(bpy.types, self.nodetype).bl_rna.translation_context
# NB: is a staticmethod because called with an explicit self argument
# NodeItemCustom sets this as a variable attribute in __init__
@staticmethod
def draw(self, layout, context):
default_context = bpy.app.translations.contexts.default
props = layout.operator("node.add_node", text=self.label, text_ctxt=default_context)
props = layout.operator("node.add_node", text=self.label, text_ctxt=self.translation_context)
props.type = self.nodetype
props.use_transform = True