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:
authorJohnny Matthews <johnny.matthews@gmail.com>2021-12-01 18:36:25 +0300
committerJohnny Matthews <johnny.matthews@gmail.com>2021-12-01 18:36:25 +0300
commit17578408434fafd2463ed253eebb5cb1412a6c67 (patch)
tree7052f46de29ed0d7180c00d2a8b64c03c4941995 /source/blender/makesdna
parentf8dd03d3dd1b2d7f0ade7c209092212098c75cb4 (diff)
Geometry Nodes: Generalized Compare Node
Replace compare floats node with a generalized compare node. The node allows for the comparison of float, int, string, color, and vector. The datatypes support the following operators: Float, Int: <, >, <=, >=, ==, != String: ==, != Color: ==, !=, lighter, darker (using rgb_to_grayscale value as the brightness value) Vector Supports 5 comparison modes for: ==, !=, <, >, <=, >= Average: The average of the components of the vectors are compared. Dot Product: The dot product of the vectors are compared. Direction: The angle between the vectors is compared to an angle Element-wise: The individual components of the vectors are compared. Length: The lengths of the vectors are compared. Differential Revision: https://developer.blender.org/D13228
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 59cf4da26f6..b49635de5ef 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1606,6 +1606,16 @@ typedef struct NodeGeometryViewer {
int8_t data_type;
} NodeGeometryViewer;
+typedef struct NodeFunctionCompare {
+ /* NodeCompareOperation */
+ int8_t operation;
+ /* eNodeSocketDatatype */
+ int8_t data_type;
+ /* NodeCompareMode */
+ int8_t mode;
+ char _pad[1];
+} NodeFunctionCompare;
+
/* script node mode */
#define NODE_SCRIPT_INTERNAL 0
#define NODE_SCRIPT_EXTERNAL 1
@@ -1886,14 +1896,25 @@ enum {
};
/* Float compare node operations. */
-typedef enum FloatCompareOperation {
- NODE_FLOAT_COMPARE_LESS_THAN = 0,
- NODE_FLOAT_COMPARE_LESS_EQUAL = 1,
- NODE_FLOAT_COMPARE_GREATER_THAN = 2,
- NODE_FLOAT_COMPARE_GREATER_EQUAL = 3,
- NODE_FLOAT_COMPARE_EQUAL = 4,
- NODE_FLOAT_COMPARE_NOT_EQUAL = 5,
-} FloatCompareOperation;
+typedef enum NodeCompareMode {
+ NODE_COMPARE_MODE_ELEMENT = 0,
+ NODE_COMPARE_MODE_LENGTH = 1,
+ NODE_COMPARE_MODE_AVERAGE = 2,
+ NODE_COMPARE_MODE_DOT_PRODUCT = 3,
+ NODE_COMPARE_MODE_DIRECTION = 4
+} NodeCompareMode;
+
+typedef enum NodeCompareOperation {
+ NODE_COMPARE_LESS_THAN = 0,
+ NODE_COMPARE_LESS_EQUAL = 1,
+ NODE_COMPARE_GREATER_THAN = 2,
+ NODE_COMPARE_GREATER_EQUAL = 3,
+ NODE_COMPARE_EQUAL = 4,
+ NODE_COMPARE_NOT_EQUAL = 5,
+ NODE_COMPARE_COLOR_BRIGHTER = 6,
+ NODE_COMPARE_COLOR_DARKER = 7,
+
+} NodeCompareOperation;
/* Float to Int node operations. */
typedef enum FloatToIntRoundingMode {