Geometry Nodes: expose float2 attribute in rna

This also fixes the issue reported in T85651.

Differential Revision: https://developer.blender.org/D10477
This commit is contained in:
2021-02-20 11:33:43 +01:00
parent 173b6b792c
commit 5dced2a063
3 changed files with 53 additions and 0 deletions

View File

@@ -430,6 +430,16 @@ static void attr_create_generic(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool
});
break;
}
case BL::Attribute::data_type_FLOAT2: {
BL::Float2Attribute b_float2_attribute{b_attribute};
Attribute *attr = attributes.add(name, TypeFloat2, element);
float2 *data = attr->data_float2();
fill_generic_attribute(b_mesh, data, element, [&](int i) {
BL::Array<float, 2> v = b_float2_attribute.data[i].vector();
return make_float2(v[0], v[1]);
});
break;
}
default:
/* Not supported. */
break;