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:
authorVictor-Louis De Gusseme <victorlouis>2021-02-05 17:28:31 +0300
committerHans Goudey <h.goudey@me.com>2021-02-05 17:28:31 +0300
commit4d39a0f8eb1103aa58611fff7219f4bf3d70f70f (patch)
treecd36763c81288f8c35e25deb05bf6da4de57b20b /source/blender/editors/space_node/drawnode.c
parent7054d03701250b245df9cf60b80c3c5e9aca308f (diff)
Geometry Nodes: Add Attribute Proximity Node
This node calculates a distance from each point to the closest position on a target geometry, similar to the vertex weight proximity modifier. Mapping the output distance to a different range can be done with an attribute math node after this node. A drop-down changes whether to calculate distances from points, edges, or faces. In points mode, the node also calculates distances from point cloud points. Design task and use cases: T84842 Differential Revision: https://developer.blender.org/D10154
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r--source/blender/editors/space_node/drawnode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index d7edb1ecbed..b16ccb9bce4 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3381,6 +3381,13 @@ static void node_geometry_buts_collection_info(uiLayout *layout,
uiItemR(layout, ptr, "transform_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
+static void node_geometry_buts_attribute_proximity(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "target_geometry_element", DEFAULT_FLAGS, "", ICON_NONE);
+}
+
static void node_geometry_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
@@ -3444,6 +3451,9 @@ static void node_geometry_set_butfunc(bNodeType *ntype)
case GEO_NODE_COLLECTION_INFO:
ntype->draw_buttons = node_geometry_buts_collection_info;
break;
+ case GEO_NODE_ATTRIBUTE_PROXIMITY:
+ ntype->draw_buttons = node_geometry_buts_attribute_proximity;
+ break;
}
}