CurvesGeometry: Add initial vertex group support #106944

Merged
Falk David merged 24 commits from filedescriptor/blender:curves-deform-verts into main 2023-09-27 10:26:16 +02:00
Showing only changes of commit 3deeeb6633 - Show all commits

View File

@ -61,6 +61,10 @@ CurvesGeometry::CurvesGeometry(const int point_num, const int curve_num)
CustomData_reset(&this->point_data);
CustomData_reset(&this->curve_data);
/* Make sure to clear this before using the attributes API. Otherwise the vertex group accessor
filedescriptor marked this conversation as resolved Outdated

Not sure this comment is really necessary, it's just the same thing as the CustomData_reset calls above.

Not sure this comment is really necessary, it's just the same thing as the `CustomData_reset` calls above.
* might try to read from invalid memory. */
BLI_listbase_clear(&this->vertex_group_names);
this->attributes_for_write().add<float3>(
"position", ATTR_DOMAIN_POINT, AttributeInitConstruct());
@ -82,8 +86,6 @@ CurvesGeometry::CurvesGeometry(const int point_num, const int curve_num)
this->curve_offsets = nullptr;
}
BLI_listbase_clear(&this->vertex_group_names);
/* Fill the type counts with the default so they're in a valid state. */
this->runtime->type_counts[CURVE_TYPE_CATMULL_ROM] = curve_num;
}