mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cleanup: Remove unnecessary name copy when removing attribute
BKE_defgroup_listbase_name_find has a StringRef argument nowadays.
This commit is contained in:
parent
d3fdfe013d
commit
2fd3a633db
2 changed files with 4 additions and 9 deletions
|
|
@ -88,19 +88,16 @@ class CurvesVertexGroupsAttributeProvider final : public DynamicAttributesProvid
|
|||
return {varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
|
||||
}
|
||||
|
||||
bool try_delete(void *owner, const StringRef attribute_id) const final
|
||||
bool try_delete(void *owner, const StringRef name) const final
|
||||
{
|
||||
CurvesGeometry *curves = static_cast<CurvesGeometry *>(owner);
|
||||
if (curves == nullptr) {
|
||||
return true;
|
||||
}
|
||||
const std::string name = attribute_id;
|
||||
|
||||
int index;
|
||||
bDeformGroup *group;
|
||||
if (!BKE_defgroup_listbase_name_find(
|
||||
&curves->vertex_group_names, name.c_str(), &index, &group))
|
||||
{
|
||||
if (!BKE_defgroup_listbase_name_find(&curves->vertex_group_names, name, &index, &group)) {
|
||||
return false;
|
||||
}
|
||||
BLI_remlink(&curves->vertex_group_names, group);
|
||||
|
|
|
|||
|
|
@ -767,18 +767,16 @@ class MeshVertexGroupsAttributeProvider final : public DynamicAttributesProvider
|
|||
return {varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
|
||||
}
|
||||
|
||||
bool try_delete(void *owner, const StringRef attribute_id) const final
|
||||
bool try_delete(void *owner, const StringRef name) const final
|
||||
{
|
||||
Mesh *mesh = static_cast<Mesh *>(owner);
|
||||
if (mesh == nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string name = attribute_id;
|
||||
|
||||
int index;
|
||||
bDeformGroup *group;
|
||||
if (!BKE_id_defgroup_name_find(&mesh->id, name.c_str(), &index, &group)) {
|
||||
if (!BKE_id_defgroup_name_find(&mesh->id, name, &index, &group)) {
|
||||
return false;
|
||||
}
|
||||
BLI_remlink(&mesh->vertex_group_names, group);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue