Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
| Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | static void do_not_equal_operation(const BooleanReadAttribute &input_a, | ||||
| } | } | ||||
| } | } | ||||
| static CustomDataType get_data_type(GeometryComponent &component, | static CustomDataType get_data_type(GeometryComponent &component, | ||||
| const GeoNodeExecParams ¶ms, | const GeoNodeExecParams ¶ms, | ||||
| const NodeAttributeCompare &node_storage) | const NodeAttributeCompare &node_storage) | ||||
| { | { | ||||
| if (operation_tests_equality(node_storage)) { | if (operation_tests_equality(node_storage)) { | ||||
| CustomDataType data_type_a = params.get_input_attribute_data_type( | |||||
| "A", component, CD_PROP_FLOAT); | |||||
| CustomDataType data_type_b = params.get_input_attribute_data_type( | |||||
| "B", component, CD_PROP_FLOAT); | |||||
| /* Convert the input attributes to the same data type for the equality tests. Use the higher | /* Convert the input attributes to the same data type for the equality tests. Use the higher | ||||
| * complexity attribute type, otherwise information necessary to the comparison may be lost. */ | * complexity attribute type, otherwise information necessary to the comparison may be lost. */ | ||||
| return attribute_data_type_highest_complexity({data_type_a, data_type_b}); | return attribute_data_type_highest_complexity({ | ||||
| params.get_input_attribute_data_type("A", component, CD_PROP_FLOAT), | |||||
| params.get_input_attribute_data_type("B", component, CD_PROP_FLOAT), | |||||
| }); | |||||
| } | } | ||||
| /* Use float compare for every operation besides equality. */ | /* Use float compare for every operation besides equality. */ | ||||
| return CD_PROP_FLOAT; | return CD_PROP_FLOAT; | ||||
| } | } | ||||
| static void attribute_compare_calc(GeometryComponent &component, const GeoNodeExecParams ¶ms) | static void attribute_compare_calc(GeometryComponent &component, const GeoNodeExecParams ¶ms) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines | |||||