diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-03 19:49:51 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-03 19:49:51 +0300 |
commit | f59767ff97295404dade1bc0d494cfe81e8a97bb (patch) | |
tree | 3c6e4e2d12fa1ad5f3e36881d53c0c550013c29b /source/blender/blenloader | |
parent | 2f591adc1a95dee6e76983c81eb592b6c34d3b1a (diff) |
Curves: Changes to the new curves data-block
This patch refactors the "Hair" data-block, which will soon be renamed
to "Curves". The larger change is switching from an array of `HairCurve`
to find indices in the points array to simply storing an array of offsets.
Using a single integer instead of two halves the amount of memory for that
particular array.
Besides that, there are some other changes in this patch:
- Split the data-structure to a separate `CurveGeometry`
DNA struct so it is usable for grease pencil too.
- Update naming to be more aligned with newer code and the style guide.
- Add direct access to some arrays in RNA
-- Radius is now retrieved as a regular attribute in Cycles.
-- `HairPoint` has been renamed to `CurvePoint`
-- `HairCurve` has been renamed to `CurveSlice`
- Add comments to the struct in DNA.
The next steps are renaming `Hair` -> `Curves`, and adding support
for other curve types: Bezier, Poly, and NURBS.
Ref T95355
Differential Revision: https://developer.blender.org/D13987
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 888bd244007..ef146606ff0 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1122,7 +1122,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Hair and PointCloud attributes. */ for (Hair *hair = bmain->hairs.first; hair != NULL; hair = hair->id.next) { - do_versions_point_attributes(&hair->pdata); + do_versions_point_attributes(&hair->geometry.point_data); } for (PointCloud *pointcloud = bmain->pointclouds.first; pointcloud != NULL; pointcloud = pointcloud->id.next) { @@ -1424,7 +1424,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Hair and PointCloud attributes names. */ LISTBASE_FOREACH (Hair *, hair, &bmain->hairs) { - do_versions_point_attribute_names(&hair->pdata); + do_versions_point_attribute_names(&hair->geometry.point_data); } LISTBASE_FOREACH (PointCloud *, pointcloud, &bmain->pointclouds) { do_versions_point_attribute_names(&pointcloud->pdata); |