[Bf-blender-cvs] [84cc00f3b68] master: Fix T83989: Attribute Math node ignores its operation setting

Garry R. Osgood noreply at git.blender.org
Mon Dec 21 01:48:33 CET 2020


Commit: 84cc00f3b68e12209e000008f992fad3ac48f757
Author: Garry R. Osgood
Date:   Sun Dec 20 18:46:24 2020 -0600
Branches: master
https://developer.blender.org/rB84cc00f3b68e12209e000008f992fad3ac48f757

Fix T83989: Attribute Math node ignores its operation setting

T83989 observes that the Attribute Math node always adds its
operands regardless of its operator setting. This was caused
by an oversight committed in rB23233fcf056e42, which overlooked
adjusting the exec function to use the new storage location.

Differential Revision: https://developer.blender.org/D9909

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc

===================================================================

diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
index a7b71fa614f..997b85c5e9d 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_math.cc
@@ -97,7 +97,8 @@ static void do_math_operation(const FloatReadAttribute &input_a,
 static void attribute_math_calc(GeometryComponent &component, const GeoNodeExecParams &params)
 {
   const bNode &node = params.node();
-  const int operation = node.custom1;
+  const NodeAttributeMath *node_storage = (const NodeAttributeMath *)node.storage;
+  const int operation = node_storage->operation;
 
   /* The result type of this node is always float. */
   const CustomDataType result_type = CD_PROP_FLOAT;



More information about the Bf-blender-cvs mailing list