Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_color_ramp.cc
| Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | static void execute_on_component(const GeoNodeExecParams ¶ms, GeometryComponent &component) | ||||
| if (!attribute_result) { | if (!attribute_result) { | ||||
| return; | return; | ||||
| } | } | ||||
| FloatReadAttribute attribute_in = component.attribute_get_for_read<float>( | FloatReadAttribute attribute_in = component.attribute_get_for_read<float>( | ||||
| input_name, result_domain, 0.0f); | input_name, result_domain, 0.0f); | ||||
| Span<float> data_in = attribute_in.get_span(); | Span<float> data_in = attribute_in.get_span(); | ||||
| MutableSpan<Color4f> data_out = attribute_result->get_span_for_write_only<Color4f>(); | MutableSpan<ColorGeometry> data_out = attribute_result->get_span_for_write_only<ColorGeometry>(); | ||||
| ColorBand *color_ramp = &node_storage->color_ramp; | ColorBand *color_ramp = &node_storage->color_ramp; | ||||
| for (const int i : data_in.index_range()) { | for (const int i : data_in.index_range()) { | ||||
| BKE_colorband_evaluate(color_ramp, data_in[i], data_out[i]); | BKE_colorband_evaluate(color_ramp, data_in[i], data_out[i]); | ||||
| } | } | ||||
| attribute_result.apply_span_and_save(); | attribute_result.apply_span_and_save(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||