UI: "vertex keys" -> "shape keys" #104868
|
@ -1137,48 +1137,6 @@ class VertexGroupsAttributeProvider final : public DynamicAttributesProvider {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* This provider makes face normals available as a read-only float3 attribute.
|
||||
*/
|
||||
class NormalAttributeProvider final : public BuiltinAttributeProvider {
|
||||
public:
|
||||
NormalAttributeProvider()
|
||||
: BuiltinAttributeProvider(
|
||||
"normal", ATTR_DOMAIN_FACE, CD_PROP_FLOAT3, NonCreatable, Readonly, NonDeletable)
|
||||
{
|
||||
}
|
||||
|
||||
GVArray try_get_for_read(const void *owner) const final
|
||||
{
|
||||
const Mesh *mesh = static_cast<const Mesh *>(owner);
|
||||
if (mesh == nullptr || mesh->totpoly == 0) {
|
||||
return {};
|
||||
}
|
||||
return VArray<float3>::ForSpan({(float3 *)BKE_mesh_poly_normals_ensure(mesh), mesh->totpoly});
|
||||
}
|
||||
|
||||
GAttributeWriter try_get_for_write(void * /*owner*/) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
bool try_delete(void * /*owner*/) const final
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool try_create(void * /*owner*/, const AttributeInit & /*initializer*/) const final
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool exists(const void *owner) const final
|
||||
{
|
||||
const Mesh *mesh = static_cast<const Mesh *>(owner);
|
||||
return mesh->totpoly != 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* In this function all the attribute providers for a mesh component are created. Most data in this
|
||||
* function is statically allocated, because it does not change over time.
|
||||
|
@ -1229,8 +1187,6 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
|
|||
make_array_write_attribute<float3>,
|
||||
tag_component_positions_changed);
|
||||
|
||||
static NormalAttributeProvider normal;
|
||||
|
||||
static BuiltinCustomDataLayerProvider id("id",
|
||||
ATTR_DOMAIN_POINT,
|
||||
CD_PROP_INT32,
|
||||
|
@ -1308,7 +1264,7 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh()
|
|||
static CustomDataAttributeProvider face_custom_data(ATTR_DOMAIN_FACE, face_access);
|
||||
|
||||
return ComponentAttributeProviders(
|
||||
{&position, &id, &material_index, &shade_smooth, &sharp_edge, &normal, &crease},
|
||||
{&position, &id, &material_index, &shade_smooth, &sharp_edge, &crease},
|
||||
{&corner_custom_data,
|
||||
&vertex_groups,
|
||||
&point_custom_data,
|
||||
|
|
Loading…
Reference in New Issue