Page MenuHome

Cycles Math Multiply Add does not work anymore
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-5.10.0-6-amd64-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.73.01

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-14 02:46, hash: rB8f2b60ddbfea
Worked: always

Bisecting points to rB6d24017529fd: Cleanup: use socket identifier instead of names in Cycles shader export being the culprit commit.

Short description of error
The Addend value of the multiply add math node is not added, when using Cycles.

Exact steps for others to reproduce the error

  1. Go to shader nodes and add a Math node
  2. Change the Math node to Multiply Add and display it (Ctrl+Shift)
  3. Change the addend and observe the color of the cube in Eevee and in Cycles. (stay the same color in Cycles)

Event Timeline

Alaska (Alaska) changed the task status from Needs Triage to Confirmed.Aug 16 2021, 2:29 AM
Alaska (Alaska) edited projects, added Render & Cycles; removed Cycles.
Alaska (Alaska) changed the subtype of this task from "Report" to "Bug".
Alaska (Alaska) added a subscriber: Alaska (Alaska).

Can confirm. I'll bisect the issue to see what I can find.

System Information:
Operating system: Linux-5.10.0-8-amd64-x86_64-with-glibc2.31 64 Bits
Graphics card: NA

Blender Version:
Broken version: 3.0.0 Alpha, branch: master, commit date: 2021-08-15 23:08, hash: rB899935d5d024

Introduced in rB6d24017529fd: Cleanup: use socket identifier instead of names in Cycles shader export

Possible fix below, @Brecht Van Lommel (brecht), do you want to make a more robust fix?

diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index bf481ab4e3d..f5b4b77d388 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -1047,6 +1047,9 @@ static ShaderInput *node_find_input_by_name(ShaderNode *node, BL::NodeSocket &b_
       if (string_endswith(name, "_001")) {
         string_replace(name, "_001", "2");
       }
+      else if (string_endswith(name, "_002")) {
+        string_replace(name, "_002", "3");
+      }
       else {
         name += "1";
       }

Edit: Snap @Alaska (Alaska) 😆

Pratik Borhade (PratikPB2123) triaged this task as High priority.Aug 16 2021, 10:37 AM

Recent regression: marking a high priority issue.