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
committerJeroen Bakker <jeroen@blender.org>2021-07-26 09:42:53 +0300
commit05ffe05ebcd36688e3f3c178e3797aeffb1eb647 (patch)
tree1f52cabeeb4d87b16723cbe354cbe35f8c03918b /release
parent00b135a37923100ae578accfcbd579b3b969a05c (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
Diffstat (limited to 'release')
-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 0c7a2a01b7a..d272e163178 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'}