Fix context menu w/o an active object
Also remove special case when no items are selected, since this only has one or two menu items, one being the add menu which can be better accessed from the header or add shortcut. If the no-selection case is to have it's own alternate menu - it should be more complete before enabling.
This commit is contained in:
@@ -328,12 +328,15 @@ class NODE_MT_specials(Menu):
|
||||
layout = self.layout
|
||||
|
||||
# If nothing is selected
|
||||
# (disabled for now until it can be made more useful).
|
||||
'''
|
||||
selected_nodes_len = len(context.selected_nodes)
|
||||
if selected_nodes_len == 0:
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.menu("NODE_MT_add")
|
||||
layout.operator("node.clipboard_paste", text="Paste")
|
||||
return
|
||||
'''
|
||||
|
||||
# If something is selected
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
|
Reference in New Issue
Block a user