Node Wrangler: Lazy Mix on float outputs in Geometry Nodes gives error #104480

Closed
opened 2023-03-13 11:24:27 +01:00 by Sun Kim · 3 comments
Contributor

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.0 Core Profile Context 23.2.2.230217

Blender Version
Broken: version: 3.6.1 Alpha, branch: main, commit date: 2023-03-12 21:35, hash: cbc73a1e0596
Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-03 23:37, hash: d0cfbc23db81

Addon Information
Name: Node Wrangler (3, 44)
Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer

Short description of error
In Geometry Nodes editor, using Lazy Mix (Ctrl + Shift + RMB-drag) on nodes with float outputs (ex: Value, Noise Texture, Voronoi Texture...) gives an error.

Python: Traceback (most recent call last):
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\addons\node_wrangler\operators.py", line 79, in modal
    bpy.ops.node.nw_merge_nodes(mode="MIX", merge_type="AUTO")
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\addons\node_wrangler\operators.py", line 1353, in execute
    add.operation = mode
TypeError: bpy_struct: item.attr = val: enum "MIX" not found in ('ADD', 'SUBTRACT', 'MULTIPLY', 'DIVIDE', 'MULTIPLY_ADD', 'POWER', 'LOGARITHM', 'SQRT', 'INVERSE_SQRT', 'ABSOLUTE', 'EXPONENT', 'MINIMUM', 'MAXIMUM', 'LESS_THAN', 'GREATER_THAN', 'SIGN', 'COMPARE', 'SMOOTH_MIN', 'SMOOTH_MAX', 'ROUND', 'FLOOR', 'CEIL', 'TRUNC', 'FRACT', 'MODULO', 'WRAP', 'SNAP', 'PINGPONG', 'SINE', 'COSINE', 'TANGENT', 'ARCSINE', 'ARCCOSINE', 'ARCTANGENT', 'ARCTAN2', 'SINH', 'COSH', 'TANH', 'RADIANS', 'DEGREES')
Location: C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py:113

Exact steps for others to reproduce the error

  • In Geometry Nodes editor, add 2 nodes with float outputs (ex: Value, Noise Texture, Voronoi Texture...)
  • Use Lazy Mix (Ctrl + Shift + RMB-drag) on these 2 nodes

off-topic:
In March 3 build, Lazy Mix on float outputs in GeoNodes editor generates a Math node with Add mode. (Unlike in Shader node, which generates a Mix node. I still find this inconsistency odd but this is off-topic for this bug report.)

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.0 Core Profile Context 23.2.2.230217 **Blender Version** Broken: version: 3.6.1 Alpha, branch: main, commit date: 2023-03-12 21:35, hash: `cbc73a1e0596` Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-03 23:37, hash: `d0cfbc23db81` **Addon Information** Name: Node Wrangler (3, 44) Author: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer **Short description of error** In Geometry Nodes editor, using Lazy Mix (Ctrl + Shift + RMB-drag) on nodes with float outputs (ex: Value, Noise Texture, Voronoi Texture...) gives an error. ``` Python: Traceback (most recent call last): File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\addons\node_wrangler\operators.py", line 79, in modal bpy.ops.node.nw_merge_nodes(mode="MIX", merge_type="AUTO") File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__ ret = _op_call(self.idname_py(), None, kw) RuntimeError: Error: Python: Traceback (most recent call last): File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\addons\node_wrangler\operators.py", line 1353, in execute add.operation = mode TypeError: bpy_struct: item.attr = val: enum "MIX" not found in ('ADD', 'SUBTRACT', 'MULTIPLY', 'DIVIDE', 'MULTIPLY_ADD', 'POWER', 'LOGARITHM', 'SQRT', 'INVERSE_SQRT', 'ABSOLUTE', 'EXPONENT', 'MINIMUM', 'MAXIMUM', 'LESS_THAN', 'GREATER_THAN', 'SIGN', 'COMPARE', 'SMOOTH_MIN', 'SMOOTH_MAX', 'ROUND', 'FLOOR', 'CEIL', 'TRUNC', 'FRACT', 'MODULO', 'WRAP', 'SNAP', 'PINGPONG', 'SINE', 'COSINE', 'TANGENT', 'ARCSINE', 'ARCCOSINE', 'ARCTANGENT', 'ARCTAN2', 'SINH', 'COSH', 'TANH', 'RADIANS', 'DEGREES') Location: C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\scripts\modules\bpy\ops.py:113 ``` **Exact steps for others to reproduce the error** - In Geometry Nodes editor, add 2 nodes with float outputs (ex: Value, Noise Texture, Voronoi Texture...) - Use Lazy Mix (Ctrl + Shift + RMB-drag) on these 2 nodes --- **off-topic:** In March 3 build, Lazy Mix on float outputs in GeoNodes editor generates a Math node with Add mode. (Unlike in Shader node, which generates a Mix node. I still find this inconsistency odd but this is off-topic for this bug report.)
Sun Kim added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-13 11:24:27 +01:00

I can confirm the issue. Looks like a recent regression.

I can confirm the issue. Looks like a recent regression.
Germano Cavalcante added
Status
Confirmed
Interest
Nodes & Physics
and removed
Status
Needs Triage
labels 2023-03-13 15:00:40 +01:00
Member

This was caused by f592ca10, which also affects 3.5.

@wannes.malfait I think these two lines are actually needed, and they don’t seem to break the lazy mix, but maybe they were removed for another reason?

diff --git a/node_wrangler/__init__.py b/node_wrangler/__init__.py
index 5566977b..f9d92b77 100644
--- a/node_wrangler/__init__.py
+++ b/node_wrangler/__init__.py
@@ -2095,6 +2095,8 @@ class NWMergeNodes(Operator, NWBase):
             if tree_type == 'GEOMETRY':
                 if nodes_list is selected_math or nodes_list is selected_vector or nodes_list is selected_mix:
                     node_type = 'ShaderNode'
+                    if mode == 'MIX':
+                        mode = 'ADD'
                 else:
                     node_type = 'GeometryNode'
             if merge_position == 'CENTER':
This was caused by f592ca10, which also affects 3.5. @wannes.malfait I think these two lines are actually needed, and they don’t seem to break the lazy mix, but maybe they were removed for another reason? ```diff diff --git a/node_wrangler/__init__.py b/node_wrangler/__init__.py index 5566977b..f9d92b77 100644 --- a/node_wrangler/__init__.py +++ b/node_wrangler/__init__.py @@ -2095,6 +2095,8 @@ class NWMergeNodes(Operator, NWBase): if tree_type == 'GEOMETRY': if nodes_list is selected_math or nodes_list is selected_vector or nodes_list is selected_mix: node_type = 'ShaderNode' + if mode == 'MIX': + mode = 'ADD' else: node_type = 'GeometryNode' if merge_position == 'CENTER': ```
Member

I removed these lines since the mix node in geometry nodes was being set to 'ADD' even when doing the "lazy mix". I did not realize this would cause problems with float outputs. For me it's fine to revert this specific change for now. We can then make the behaviour more consistent in the future

I removed these lines since the mix node in geometry nodes was being set to 'ADD' even when doing the "lazy mix". I did not realize this would cause problems with float outputs. For me it's fine to revert this specific change for now. We can then make the behaviour more consistent in the future
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-03-22 00:20:55 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104480
No description provided.