WIP: uv-simple-select (Version2) #2

Draft
Chris Blackbourn wants to merge 3 commits from uv-simple-select into main

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

Modify UV Face Select and UV Island Select to use "touching" instead of face centers.

Affects:

  • UV Click Select (Including "penalty" system)
  • UV Box Select
  • UV Circle Select
  • UV Lasso Select
Modify UV Face Select and UV Island Select to use "touching" instead of face centers. Affects: * UV Click Select (Including "penalty" system) * UV Box Select * UV Circle Select * UV Lasso Select
Chris Blackbourn added 2 commits 2023-02-17 00:48:35 +01:00
Like in the 3D viewport, UV Face Selection was previously based on
distance to the face center.

Instead, measure distance to nearest edge instead, which is more
consistent with a 2D viewport.
Implement "Face Touching" UV selection for Box Select, Lasso Select
and Circle Select.

Implement "Penalty" system for UV click select.
Chris Blackbourn changed title from uv-simple-select (Version2) to WIP: uv-simple-select (Version2) 2023-02-17 00:52:17 +01:00
Chris Blackbourn added 3 commits 2023-02-17 01:22:18 +01:00
This adds `BitSpan` and `MutableBitSpan`. They work essentially the same as
the normal `Span` and `MutableSpan`, but work on individual bits instead
(the smallest type `Span` can handle is one byte large).

This also splits up `BLI_bit_vector.hh` and introduces two new headers:
`BLI_bit_ref.hh` and `BLI_bit_span.hh`.

The goal here is to make working with dynamically sized bit masks more
convenient. I'm mainly working on this because I might want to use this
in #104629. It can also be used to cleanup function signatures that
currently take a reference to a `BitVector`. Like with `Span` vs. `Vector`,
it is better to pass a `BitSpan` to function than a `const BitVector &`.

Unit tests for the new code are included.

Pull Request #104671
Passing a `BitSpan` is generally better because then the caller is not
forced to allocate the bits with a `BitVector`. Also, the `BitSpan` can
be stored in the stack, which removes one pointer indirection compared
to accessing bits through a `BitVector &`.
This pull request has changes conflicting with the target branch.
  • source/blender/editors/include/ED_uvedit.h
  • source/blender/editors/uvedit/uvedit_intern.h
  • source/blender/editors/uvedit/uvedit_select.c

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin uv-simple-select:uv-simple-select
git checkout uv-simple-select
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Chris_Blackbourn/blender#2
No description provided.