Geometry Nodes: output color from Attribute Color Ramp node

The other output types did not work currently anyway.
There is not a significant benefit in somehow deducing the output
attribute type from the existing attribute types.
This commit is contained in:
Jacques Lucke 2021-01-14 12:44:37 +01:00
parent 442b6e5e09
commit 10423d462a
Notes: blender-bot 2023-02-14 06:00:50 +01:00
Referenced by issue #84702, Crash with attribute color ramp node
1 changed files with 4 additions and 3 deletions

View File

@ -37,9 +37,10 @@ static void execute_on_component(const GeoNodeExecParams &params, GeometryCompon
const bNode &bnode = params.node();
NodeAttributeColorRamp *node_storage = (NodeAttributeColorRamp *)bnode.storage;
/* Use the type of the input attribute, but create a color attribute if it doesn't exist yet. */
const CustomDataType result_type = params.get_input_attribute_data_type(
"Attribute", component, CD_PROP_COLOR);
/* Always output a color attribute for now. We might want to allow users to customize.
* Using the type of an existing attribute could work, but does not have a real benefit
* currently. */
const CustomDataType result_type = CD_PROP_COLOR;
const std::string result_name = params.get_input<std::string>("Result");
/* Once we support more domains at the user level, we have to decide how the result domain is