Fix #109547: Error creating geometry node group from property editor

Mistake in e4cc91a611 that assumed
the operator was always run from the node editor.
This commit is contained in:
Hans Goudey
2023-06-30 11:53:40 -04:00
parent f6f3a6a928
commit 6eea4acc62

View File

@@ -237,10 +237,10 @@ class NewGeometryNodeTreeAssign(Operator):
return geometry_modifier_poll(context)
def execute(self, context):
snode = context.space_data
if snode and snode.geometry_nodes_type == 'OPERATOR':
space = context.space_data
if space and space.type == 'NODE_EDITOR' and space.geometry_nodes_type == 'OPERATOR':
group = geometry_node_group_empty_new()
snode.node_tree = group
space.node_tree = group
return {'FINISHED'}
else:
modifier = get_context_modifier(context)