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-01-21 18:47:03 +0300
committerJacques Lucke <jacques@blender.org>2021-01-21 18:49:06 +0300
commit425e706921a8f986921b8b9c429874fed98e9a10 (patch)
tree88275db9e9ec65cd84c210a03799b285f1a0671f /source/blender/editors/space_node/drawnode.c
parenta92ebab5da3bcbe3ee1b87348e51f6bcb347b881 (diff)
Geometry Nodes: new Attribute Sample Texture node
This node allows sampling a texture for every vertex based on some mapping attribute. Typical attribute names are the name of a uv map (e.g. "UVMap") and "position". However, every attribute that can be converted to a vector implicitly is supported. It should be noted that as of right now, uv map attributes can only be accessed after a Point Distribute node. Ref T82584. Differential Revision: https://developer.blender.org/D10121
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 7b09f681dfa..130ea430ecd 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3289,6 +3289,13 @@ static void node_geometry_buts_object_info(uiLayout *layout, bContext *UNUSED(C)
uiItemR(layout, ptr, "transform_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
}
+static void node_geometry_buts_attribute_sample_texture(uiLayout *layout,
+ bContext *C,
+ PointerRNA *ptr)
+{
+ uiTemplateID(layout, C, ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL);
+}
+
static void node_geometry_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
@@ -3343,6 +3350,9 @@ static void node_geometry_set_butfunc(bNodeType *ntype)
case GEO_NODE_OBJECT_INFO:
ntype->draw_buttons = node_geometry_buts_object_info;
break;
+ case GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE:
+ ntype->draw_buttons = node_geometry_buts_attribute_sample_texture;
+ break;
}
}