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:
authorJacques Lucke <jacques@blender.org>2021-09-23 23:21:31 +0300
committerHans Goudey <h.goudey@me.com>2021-09-23 23:21:31 +0300
commit61f3d4eb7c7db711f9339d05e68b8f9eac3ce167 (patch)
tree9004c577411998029bda688d5659d1a98be484f4 /source/blender/makesdna
parentc1b925f7fff5f8b26daa05b3105cbb10dfc175e7 (diff)
Geometry Nodes: Initial socket visualization for fields.
This implements the update logic for the vizualization of which sockets pass data or constants directly, and which pass functions. The socket shapes may still have to be updated. That should be done separately, because it might be a bit more involved, because socket shapes are currently linked to keyframe shapes. Currently the circle and diamond shapes are used with the following meanings: - Input Sockets: - Circle: Required to be a single value. - Diamond: This input supports fields. - Output Sockets: - Circle: This output is a single value. - Diamond: This output may be a field. Connecting a field to a circle input socket is an error, since a field cannot be converted to a single value. If the socket shape is a diamond with a dot in the middle, it means it is currently a single value, but could be a field. In addition to socket shapes, the intention is to draw node links differently based on the field status. However, the exact method for conveying that isn't decided yet. Differential Revision: https://developer.blender.org/D12584
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 18545666796..a52816ecf57 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -445,6 +445,7 @@ typedef struct bNodeLink {
#define NODE_LINK_TEST (1 << 2) /* free test flag, undefined */
#define NODE_LINK_TEMP_HIGHLIGHT (1 << 3) /* Link is highlighted for picking. */
#define NODE_LINK_MUTED (1 << 4) /* Link is muted. */
+#define NODE_LINK_DRAGGED (1 << 5) /* Node link is being dragged by the user. */
/* tree->edit_quality/tree->render_quality */
#define NTREE_QUALITY_HIGH 0
@@ -459,6 +460,8 @@ typedef struct bNodeLink {
#define NTREE_CHUNKSIZE_512 512
#define NTREE_CHUNKSIZE_1024 1024
+struct FieldInferencingInterface;
+
/* the basis for a Node tree, all links and nodes reside internal here */
/* only re-usable node trees are in the library though,
* materials and textures allocate own tree struct */
@@ -481,6 +484,8 @@ typedef struct bNodeTree {
float view_center[2];
ListBase nodes, links;
+ /** Information about how inputs and outputs of the node group interact with fields. */
+ struct FieldInferencingInterface *field_inferencing_interface;
/** Set init on fileread. */
int type, init;
@@ -575,6 +580,9 @@ typedef enum eNodeTreeUpdate {
NTREE_UPDATE_NODES = (1 << 1), /* nodes or sockets have been added or removed */
NTREE_UPDATE_GROUP_IN = (1 << 4), /* group inputs have changed */
NTREE_UPDATE_GROUP_OUT = (1 << 5), /* group outputs have changed */
+ /* The field interface has changed. So e.g. an output that was always a field before is not
+ * anymore. This implies that the field type inferencing has to be done again. */
+ NTREE_UPDATE_FIELD_INFERENCING = (1 << 6),
/* group has changed (generic flag including all other group flags) */
NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT),
} eNodeTreeUpdate;