Previously we always had to set attribute values after creating the
attribute. This patch adds an initializer argument to attribute_try_create
which can fill it in a few ways, which are explained in code comments.
I tested the "move" initializer with the following code in the attribute
fill node. I'm sure there's a better way to do it, but I just wanted to
make sure it worked.
const float value = params.get_input<float>("Value_001"); float *values = (float *)MEM_malloc_arrayN( component.attribute_domain_size(result_domain), sizeof(float), __func__); for (const int i : IndexRange(component.attribute_domain_size(result_domain))) { values[i] = value; } component.attribute_try_create( attribute_name, result_domain, data_type, AttributeInitMove(values));
This fixes T87597.