Age | Commit message (Collapse) | Author |
|
|
|
|
|
Add element_map->island_total_uvs.
Add element_map->island_total_unique_uvs.
Simplify callers based on new members.
Add comments.
Resolves: D15598
|
|
Add #bm_uv_ensure_head_table
See also: D15598
|
|
Migrate island calculation to #bm_uv_build_islands.
Simplify connectedness calculation.
Reduce memory pressure.
No functional changes.
See also: D15598
|
|
|
|
|
|
|
|
|
|
|
|
Fix copy+paste bug
|
|
Rename vert -> vertex.
Add `BM_uv_element_get_head`.
See also: D15598
|
|
Rename buf -> storage.
See also: D15598
|
|
See also: D15598
|
|
|
|
The specific functions for vertex colors and and sculpt vertex colors
can be replaced by more generic attribute functions internally.
Also remove a paramter from one function.
|
|
The "Color Attributes" system from f7bbc7cdbb6cb0d2850 has replaced
both "Sculpt Vertex Colors" and "Vertex Colors" in the UI. The Operators
for adding and removing them are unused now.
This commit does not break backwards compatibility with the Python
API, it only removes the operators, which generally aren't used by
addons anyway. The mesh RNA properties will be removed in 4.0 (T100153).
Differential Revision: https://developer.blender.org/D15077
|
|
|
|
|
|
|
|
Replace verbose ELEM(..) usage, now each kind of mouse event has it's
own macro.
|
|
|
|
|
|
Differential Revision: https://developer.blender.org/D15419
|
|
Simplify interface, regularize implementation and some light cleanup.
See also: T79304 and D15419.
|
|
In some cases it is mandatory to be able to hide parts of the mesh
in order to paint certain areas. The Mask modifier doesn't work in
weight paint, and edit mode hiding requires using selection, which
is not always convenient.
This makes the weight and vertex paint modes always respect edit mode
hiding like sculpt mode. The change in behavior affects drawing and
building paint PBVH. Thus it affects brushes, but not menu operators
like Smooth or Normalize.
In addition, this makes the Alt-H shortcut available even without
any selection enabled, and implements Hide for vertex selection.
Differential Revision: https://developer.blender.org/D14163
|
|
|
|
|
|
This commit adds a new face nearest snapping mode, adds new snapping
options, and (lightly) refactors code around snapping.
The new face nearest snapping mode will snap transformed geometry to the
nearest surface in world space. In contrast, the original face snapping
mode uses projection (raycasting) to snap source to target geometry.
Face snapping therefore only works with what is visible, while nearest
face snapping can snap geometry to occluded parts of the scene. This new
mode is critical for retopology work, where some of the target mesh
might be occluded (ex: sliding an edge loop that wraps around the
backside of target mesh).
The nearest face snapping mode has two options: "Snap to Same Target"
and "Face Nearest Steps". When the Snap to Same Object option is
enabled, the selected source geometry will stay near the target that it
is nearest before editing started, which prevents the source geometry
from snapping to other targets. The Face Nearest Steps divides the
overall transformation for each vertex into n smaller transformations,
then applies those n transformations with surface snapping interlacing
each step. This steps option handles transformations that cross U-shaped
targets better.
The new snapping options allow the artist to better control which target
objects (objects to which the edited geometry is snapped) are considered
when snapping. In particular, the only option for filtering target
objects was a "Project onto Self", which allowed the currently edited
mesh to be considered as a target. Now, the artist can choose any
combination of the following to be considered as a target: the active
object, any edited object that isn't active (see note below), any non-
edited object. Additionally, the artist has another snapping option to
exclude objects that are not selectable as potential targets.
The Snapping Options dropdown has been lightly reorganized to allow for
the additional options.
Included in this patch:
- Snap target selection is more controllable for artist with additional
snapping options.
- Renamed a few of the snap-related functions to better reflect what
they actually do now. For example, `applySnapping` implies that this
handles the snapping, while `applyProject` implies something entirely
different is done there. However, better names would be
`applySnappingAsGroup` and `applySnappingIndividual`, respectively,
where `applySnappingIndividual` previously only does Face snapping.
- Added an initial coordinate parameter to snapping functions so that
the nearest target before transforming can be determined(for "Snap to
Same Object"), and so the transformation can be broken into smaller
steps (for "Face Nearest Steps").
- Separated the BVH Tree getter code from mesh/edit mesh to its own
function to reduce code duplication.
- Added icon for nearest face snapping.
- The original "Project onto Self" was actually not correct! This option
should be called "Project onto Active" instead, but that only matters
when editing multiple meshes at the same time. This patch makes this
change in the UI.
Reviewed By: Campbell Barton, Germano Cavalcante
Differential Revision: https://developer.blender.org/D14591
|
|
|
|
The knife BVH raycast functionality was missing a check to discard
points which were clipped.
|
|
|
|
into enums
The transformation snapping code contains a bunch of `#define`s, some ambiguously or incorrectly named attributes. This patch contains refactored code to improve this. This patch does (should) not change functionality of snapping.
Clarified ambiguously / incorrectly named attributes.
- "Target" is used to refer to the part of the source that is to be snapped (Active, Median, Center, Closest), but several other areas of Blender use the term "target" to refer to the thing being snapped to and "source" to refer to the thing getting snapped. Moreover, the implications of the previous terms do not match the descriptions. For example: `SCE_SNAP_TARGET_CENTER` does not snap the grabbed geometry to the center of the target, but instead "Snap transforamtion center onto target".
- "Select" refers to the condition for an object to be a possible target for snapping.
- `SCE_SNAP_MODE_FACE` is renamed to `SCE_SNAP_MODE_FACE_RAYCAST` to better describe its affect and to make way for other face snapping methods (ex: nearest).
Refactored related `#define` into `enum`s. In particular, constants relating to...
- `ToolSettings.snap_flag` are now in `enum eSnapFlag`
- `ToolSettings.snap_mode` are now in `enum eSnapMode`
- `ToolSettings.snap_source` (was `snap_target`) are now in `enum eSnapSourceSelect`
- `ToolSettings.snap_flag` (`SCE_SNAP_NO_SELF`) and `TransSnap.target_select` are now in `enum eSnapTargetSelect`
As the terms became more consistent and the constants were packed together into meaningful enumerations, some of the attribute names seemed ambiguous. For example, it is unclear whether `SnapObjectParams.snap_select` referred to the target or the source. This patch also adds a small amount of clarity.
This patch also swaps out generic types (ex: `char`, `short`, `ushort`) and unclear hard coded numbers (ex: `0`) used with snap-related enumerations with the actual `enum`s and values.
Note: I did leave myself some comments to follow-up with further refactoring. Specifically, using "target" and "source" consistently will mean the Python API will need to change (ex: `ToolSettings.snap_target` is not `ToolSettings.snap_source`). If the API is going to change, it would be good to make sure that the used terms are descriptive enough. For example, `bpy.ops.transform.translate` uses a `snap` argument to determine if snapping should be enabled while transforming. Perhaps `use_snap` might be an improvement that's more consistent with other conventions.
This patch is (mostly) a subset of D14591, as suggested by @mano-wii.
Task T69342 proposes to separate the `Absolute Grid Snap` option out from `Increment` snapping method into its own method. Also, there might be reason to create additional snapping methods or options. (Indeed, D14591 heads in this direction). This patch can work along with these suggestions, as this patch is trying to clarify the snapping code and to prompt more work in this area.
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D15037
|
|
|
|
|
|
|
|
Knife could display incorrect snapping angle printout in
header/footer because it was not always updated after angle snapping
calculations.
|
|
|
|
- CustomDataType -> eCustomDataType
- CustomDataMask -> eCustomDataMask
- AttributeDomain -> eAttrDomain
- NamedAttributeUsage -> eNamedAttrUsage
|
|
|
|
Minor error in if condition used for early return.
Ref D15050
|
|
When the 'compare' is not used for the resulting selection, just hide
it. This is the case for 'Vertex Groups' atm (where only membership is
taken into account).
Similar to rB9dc9692b0979.
Differential Revision: https://developer.blender.org/D14979
|
|
|
|
Sorting faces caused the tessellation data to be outdated,
making faces show the wrong materials.
Re-calculate tessellation when re-ordering faces.
|
|
- Use early return and continue to reduce right-shift.
- Rename `lv` to `tri_cos` for storing triangle coordinates.
- Reduce variable scope.
|
|
|
|
|
|
Regression in [0] which removed the call to BVH-tree recalculation
before calculating the selection.
Instead of recalculating the BVH-tree, postpone recalculating mesh data
until after the selection has been calculated.
[0]: 6e77afe6ec7b6a73f218f1fef264758abcbc778a
|
|
Added in [0] but isn't needed as all needed variables are in the
ViewContext. Avoid passing in the context is it makes debugging
issues with MESH_OT_knife_project more difficult to investigate since
it's possible values written to the ViewContext are ignored.
[0]: 6e77afe6ec7b6a73f218f1fef264758abcbc778a
|
|
|