Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_component_mesh.cc
| Show First 20 Lines • Show All 916 Lines • ▼ Show 20 Lines | static bool get_shade_smooth(const MPoly &mpoly) | ||||
| return mpoly.flag & ME_SMOOTH; | return mpoly.flag & ME_SMOOTH; | ||||
| } | } | ||||
| static void set_shade_smooth(MPoly &mpoly, bool value) | static void set_shade_smooth(MPoly &mpoly, bool value) | ||||
| { | { | ||||
| SET_FLAG_FROM_TEST(mpoly.flag, value, ME_SMOOTH); | SET_FLAG_FROM_TEST(mpoly.flag, value, ME_SMOOTH); | ||||
| } | } | ||||
| static float2 get_loop_uv(const MLoopUV &uv) | |||||
| { | |||||
| return float2(uv.uv); | |||||
| } | |||||
| static void set_loop_uv(MLoopUV &uv, float2 co) | |||||
| { | |||||
| copy_v2_v2(uv.uv, co); | |||||
| } | |||||
| static float get_crease(const float &crease) | static float get_crease(const float &crease) | ||||
| { | { | ||||
| return crease; | return crease; | ||||
| } | } | ||||
| static void set_crease(float &crease, const float value) | static void set_crease(float &crease, const float value) | ||||
| { | { | ||||
| crease = std::clamp(value, 0.0f, 1.0f); | crease = std::clamp(value, 0.0f, 1.0f); | ||||
| ▲ Show 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | static BuiltinCustomDataLayerProvider crease( | ||||
| BuiltinAttributeProvider::Creatable, | BuiltinAttributeProvider::Creatable, | ||||
| BuiltinAttributeProvider::Writable, | BuiltinAttributeProvider::Writable, | ||||
| BuiltinAttributeProvider::Deletable, | BuiltinAttributeProvider::Deletable, | ||||
| edge_access, | edge_access, | ||||
| make_array_read_attribute<float>, | make_array_read_attribute<float>, | ||||
| make_derived_write_attribute<float, float, get_crease, set_crease>, | make_derived_write_attribute<float, float, get_crease, set_crease>, | ||||
| nullptr); | nullptr); | ||||
| static NamedLegacyCustomDataProvider uvs( | |||||
HooglyBoogly: If removing more code makes you happy, you could remove `NamedLegacyCustomDataProvider`… | |||||
Done Inline ActionsI'd prefer to do that separately afterwards. The patch is big enough as is. Baardaap: I'd prefer to do that separately afterwards.
The patch is big enough as is. | |||||
Done Inline Actionsdid it anyway ;-) Baardaap: did it anyway ;-) | |||||
| ATTR_DOMAIN_CORNER, | |||||
| CD_PROP_FLOAT2, | |||||
| CD_MLOOPUV, | |||||
| corner_access, | |||||
| make_derived_read_attribute<MLoopUV, float2, get_loop_uv>, | |||||
| make_derived_write_attribute<MLoopUV, float2, get_loop_uv, set_loop_uv>); | |||||
| static VertexGroupsAttributeProvider vertex_groups; | static VertexGroupsAttributeProvider vertex_groups; | ||||
| static CustomDataAttributeProvider corner_custom_data(ATTR_DOMAIN_CORNER, corner_access); | static CustomDataAttributeProvider corner_custom_data(ATTR_DOMAIN_CORNER, corner_access); | ||||
| static CustomDataAttributeProvider point_custom_data(ATTR_DOMAIN_POINT, point_access); | static CustomDataAttributeProvider point_custom_data(ATTR_DOMAIN_POINT, point_access); | ||||
| static CustomDataAttributeProvider edge_custom_data(ATTR_DOMAIN_EDGE, edge_access); | static CustomDataAttributeProvider edge_custom_data(ATTR_DOMAIN_EDGE, edge_access); | ||||
| static CustomDataAttributeProvider face_custom_data(ATTR_DOMAIN_FACE, face_access); | static CustomDataAttributeProvider face_custom_data(ATTR_DOMAIN_FACE, face_access); | ||||
| return ComponentAttributeProviders( | return ComponentAttributeProviders( | ||||
| {&position, &id, &material_index, &shade_smooth, &normal, &crease}, | {&position, &id, &material_index, &shade_smooth, &normal, &crease}, | ||||
| {&uvs, | {&corner_custom_data, | ||||
| &corner_custom_data, | |||||
| &vertex_groups, | &vertex_groups, | ||||
| &point_custom_data, | &point_custom_data, | ||||
| &edge_custom_data, | &edge_custom_data, | ||||
| &face_custom_data}); | &face_custom_data}); | ||||
| } | } | ||||
| static AttributeAccessorFunctions get_mesh_accessor_functions() | static AttributeAccessorFunctions get_mesh_accessor_functions() | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||
If removing more code makes you happy, you could remove NamedLegacyCustomDataProvider entirely. Otherwise we could do that separately afterwards