diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-23 12:27:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-23 12:28:52 +0300 |
commit | 9c7492e2e0f001c785bad1a5a1d6b8b0a9394642 (patch) | |
tree | 36c4719d6e80840a546ecd7b732ac79e86e9b7e1 /source/blender/nodes | |
parent | ec97450ac6160a8892a339a746a507e40b7d2fce (diff) |
Geometry Nodes: show domain in attribute fill node
Differential Revision: https://developer.blender.org/D10789
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc index f3bf69d567d..2139c5afa6b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc @@ -44,13 +44,14 @@ static void geo_node_attribute_fill_layout(uiLayout *layout, bContext *UNUSED(C) { uiLayoutSetPropSep(layout, true); uiLayoutSetPropDecorate(layout, false); + uiItemR(layout, ptr, "domain", 0, "", ICON_NONE); uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE); - // uiItemR(layout, ptr, "domain", 0, "", ICON_NONE); } static void geo_node_attribute_fill_init(bNodeTree *UNUSED(tree), bNode *node) { node->custom1 = CD_PROP_FLOAT; + node->custom2 = ATTR_DOMAIN_AUTO; } static void geo_node_attribute_fill_update(bNodeTree *UNUSED(ntree), bNode *node) @@ -73,7 +74,6 @@ static void geo_node_attribute_fill_update(bNodeTree *UNUSED(ntree), bNode *node namespace blender::nodes { static AttributeDomain get_result_domain(const GeometryComponent &component, - const GeoNodeExecParams ¶ms, StringRef attribute_name) { /* Use the domain of the result attribute if it already exists. */ @@ -81,10 +81,7 @@ static AttributeDomain get_result_domain(const GeometryComponent &component, if (result_attribute) { return result_attribute->domain(); } - - /* Otherwise use the input domain chosen in the interface. */ - const bNode &node = params.node(); - return static_cast<AttributeDomain>(node.custom2); + return ATTR_DOMAIN_POINT; } static void fill_attribute(GeometryComponent &component, const GeoNodeExecParams ¶ms) @@ -96,10 +93,13 @@ static void fill_attribute(GeometryComponent &component, const GeoNodeExecParams const bNode &node = params.node(); const CustomDataType data_type = static_cast<CustomDataType>(node.custom1); - const AttributeDomain domain = get_result_domain(component, params, attribute_name); + const AttributeDomain domain = static_cast<AttributeDomain>(node.custom2); + const AttributeDomain result_domain = (domain == ATTR_DOMAIN_AUTO) ? + get_result_domain(component, attribute_name) : + domain; OutputAttributePtr attribute = component.attribute_try_get_for_output( - attribute_name, domain, data_type); + attribute_name, result_domain, data_type); if (!attribute) { return; } |