Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-07-20 14:47:45 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-07-20 17:53:34 +0300
commit3e29175af3885434dc97e76c83349be7edff766c (patch)
tree151932bdf1e1029afb0ce79ea2ac9114c2164d8e
parent83b6fcc70c2b083f95a50a203592d3d5e9a17d42 (diff)
Fix T89982: Geometry Nodes: 'New' Button tries to create node_tree on active modifier, rather than button context
When done from the Properties Editor, the context's modifier should be used (this is where the button is located), when done from elsewhere, the active modifier is still the way to go (since the context modifier is not available then) Maniphest Tasks: T89982 Differential Revision: https://developer.blender.org/D11972
-rw-r--r--release/scripts/startup/bl_operators/geometry_nodes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/geometry_nodes.py b/release/scripts/startup/bl_operators/geometry_nodes.py
index 71ef89a066b..ec2887a1a74 100644
--- a/release/scripts/startup/bl_operators/geometry_nodes.py
+++ b/release/scripts/startup/bl_operators/geometry_nodes.py
@@ -81,7 +81,10 @@ class NewGeometryNodeTreeAssign(Operator):
return geometry_modifier_poll(context)
def execute(self, context):
- modifier = context.object.modifiers.active
+ if context.area.type == 'PROPERTIES':
+ modifier = context.modifier
+ else:
+ modifier = context.object.modifiers.active
if not modifier:
return {'CANCELLED'}