Commit Graph

21 Commits

Author SHA1 Message Date
Nig3l
4bede1b555 Image Mask Editor: Expose tools in the Toolbar
Expose existing mask operators as tools in the toolbar.

The primitive tools are commented out since interactively placement
isn't currently supported by the operators.

Ref !136086
2025-08-06 09:44:24 +00:00
Campbell Barton
dc83260f1a UV: split island select into a separate option, support for sync-select
Change island selection from being it's own selection mode,
along side vertex/edge & face modes, to a separate toggle.

This makes it possible to use sync-select without loosing functionality
as previously island selection didn't work when sync-select was enabled.
Now island selection supports sync-select although at the moment this
only works in face-select mode, when !138197 is merged this limitation
will be removed.

In practice this change is subtle, making it possible to toggle island
selection no matter which selection mode is currently active.

Details:

- The UI is mostly unchanged, this option is available
  in the same location in the header & menu as a toggle.
- The shortcut 4-key is kept, toggling instead of switching modes.
- Enabling island selection no longer isolates islands,
  it just acts on selection actions made after being enabled.
2025-06-12 07:09:46 +00:00
Campbell Barton
2bc284975b Refactor: remove the do_history argument from UV selection functions
Storing the selection history complicated the selection functions,
especially for situations when functions were called indirectly &
multiple times.

Remove the argument in favor of explicit calls to store elements
in the selection history.

Needed to avoid even more complexity with UV sync-select: see #131642.
2025-05-14 11:48:42 +00:00
Campbell Barton
1d80d15b8f UV: support sticky modes when face sync-select is enabled
Previously UV sync-select in face mode would isolate UV selection
so dragging a face would disconnect it from adjacent faces.

Now the sticky mode is respected for face selection.

This is needed for #136817 so storing per-selection doesn't result
in a user visible change in behavior.
2025-04-30 15:54:26 +10:00
Campbell Barton
966f936541 Cleanup: re-order functions in ED_uvedit.hh 2025-04-17 15:04:05 +10:00
Campbell Barton
69a1feabe6 Cleanup: pass BMesh instead of BMEditMesh to UV slection functions
A mix of both argument types were being used, however in almost all
cases only the BMesh is needed
2025-04-03 16:05:43 +11:00
Campbell Barton
f76d3c8eb6 Cleanup: past const arguments to UV selection testing functions 2025-03-23 05:35:17 +00:00
Campbell Barton
ff8baa6791 Cleanup: pass BMUVOffsets by const reference 2025-03-13 17:06:32 +11:00
Brecht Van Lommel
920e709069 Refactor: Make header files more clangd and clang-tidy friendly
When using clangd or running clang-tidy on headers there are
currently many errors. These are noisy in IDEs, make auto fixes
impossible, and break features like code completion, refactoring
and navigation.

This makes source/blender headers work by themselves, which is
generally the goal anyway. But #includes and forward declarations
were often incomplete.

* Add #includes and forward declarations
* Add IWYU pragma: export in a few places
* Remove some unused #includes (but there are many more)
* Tweak ShaderCreateInfo macros to work better with clangd

Some types of headers still have errors, these could be fixed or
worked around with more investigation. Mostly preprocessor
template headers like NOD_static_types.h.

Note that that disabling WITH_UNITY_BUILD is required for clangd to
work properly, otherwise compile_commands.json does not contain
the information for the relevant source files.

For more details see the developer docs:
https://developer.blender.org/docs/handbook/tooling/clangd/

Pull Request: https://projects.blender.org/blender/blender/pulls/132608
2025-01-07 12:39:13 +01:00
Campbell Barton
890f06ec42 WM: prevent potential freed memory access for the UV unwrapping timer 2024-09-21 17:17:25 +10:00
Campbell Barton
a5453ce992 Cleanup: use bool for unwrap cancel argument 2024-09-21 16:58:19 +10:00
Lukasz Czyz
788bc5158e UV: add support for the SLIM unwrapping algorithm
Integrate an existing implementation of the SLIM unwrapping algorithm
into Blender. More info about SLIM here:
https://igl.ethz.ch/projects/slim/

This commit is based on the integration code written by Aurel Gruber
for Blender 2.7x (unfinished and never merged with the main branch).

This commit is based on Aurel's code, rebased and further improved.

Details:

- Unwrap has been moved into a sub-menu,
  slim unwrapping is exposed as: "Minimum Stretch".
- Live unwrap with SLIM refines the solutions using a timer.
- When using SLIM there are options to:
  - Set the number of iterations.
  - Weight the influence using vertex weights.
- SLIM can be disabled using the `WITH_UV_SLIM` build option.

Co-authored-by: Aurel Gruber <aurel.gruber@infix.ch>

Ref !114545
2024-09-21 16:48:53 +10:00
Hans Goudey
ebbb72187a Cleanup: Use references, const, for mesh edit data flag extraction 2024-05-28 11:26:21 -04:00
Hans Goudey
9ab356fe6e Cleanup: Return Vector for View Layer objects and bases retrieval
This simplifies code using these functions because of RAII,
range based for loops, and the lack of output arguments.
Also pass object pointer array as a span in more cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/117482
2024-01-24 18:18:14 +01:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Germano Cavalcante
d81a32dcaa UV: Deduplicate code that traverses each UV
The algorithm that traverses UV is a bit complex and is being iterated
a lot in different areas of the code.

This commit deduplicates this code by creating a foreach UV function.

At the moment only the `uvedit_ops.cc` file uses this function but
similar cleanups can also be done on many other files that use UVs.
2023-08-31 15:31:05 -03:00
Germano Cavalcante
91210d8172 Cleanup: Remove unused UV functions
The usages of `ED_uvedit_minmax` and `ED_uvedit_center_from_pivot` have
probably been replaced by `ED_uvedit_minmax_multi` and
`ED_uvedit_center_from_pivot_ex` in the process to support multi-object
editing and gizmo creation respectively.
2023-08-31 15:31:05 -03:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
8d0268b09c Cleanup: spelling in comments 2023-08-09 11:20:59 +10:00
Hans Goudey
88de2f25ed Cleanup: Remove unnecessary struct keyword from editors includes 2023-08-04 22:15:25 -04:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00