WIP: Sculpt: cleanup sculpt attribute API #106920

Closed
Joseph Eagar wants to merge 7 commits from temp-sculpt-attr-api into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

7 Commits

Author SHA1 Message Date
Joseph Eagar ef8777d4e8 temp-sculpt-attr-api: Tweak API to better support short-use attribute handles
Sometimes you want to clear a SculptAttribute handle without
destroying the attribute itself.

Also removed the using namespace blender::bke::paint lines.
2023-05-09 12:56:22 -07:00
Joseph Eagar c20efffafe Merge branch 'main' into temp-sculpt-attr-api 2023-05-09 12:20:30 -07:00
Joseph Eagar 0376d9b8c2 Merge branch 'main' into temp-sculpt-attr-api 2023-05-03 14:13:59 -07:00
Joseph Eagar 9b5eadf62d Merge branch 'main' into temp-sculpt-attr-api 2023-05-02 23:37:33 -07:00
Joseph Eagar 2e8b7c832e temp-sculpt-attr-api: Make requested changes 2023-05-02 23:13:58 -07:00
Joseph Eagar 798ae0295f Merge branch 'main' into temp-sculpt-attr-api 2023-05-01 13:40:15 -07:00
Joseph Eagar fbf091750c Sculpt: cleanup sculpt attribute API
* `BKE_sculpt_vertex_attr_get` (and it's alias `SCULPT_vertex_attr_get`)
  is now `blender::bke::paint::vertex_attr_ptr`.  Same for the face
  versions of those functions.  The SCULPT_XXX aliases are removed.
* Removed code duplication; `[vertex/face]_attr_ptr` now just calls
  a generic template (`elem_attr_ptr`).
* Added `[vertex/face]_attr_get` and `[vertex/face]_attr_set` functions
  to get/set attribute data without pointer wrangling.
* Given the unwieldly length of `blender::bke::paint::` it's recommended
  to do a `using blender::bke::paint;` at the top of sculpt files.

Example: `float w = vertex_attr_get<float>(vertex,
ss->attrs.automasking_factor);`
2023-04-13 12:12:56 -07:00