Commit Graph

112212 Commits

Author SHA1 Message Date
Hans Goudey
dd1454a648 Sculpt: Various refactors in expand tool
Part of #118145.
- Specialize initialization of enabled states, parallelize for mesh.
- Pass integer index and position instead of `PBVHVertRef`.
- Rename some variables to more standard names.
- Precalculate vertex enabled state instead of calculating in loop.
2024-08-12 22:55:14 -04:00
Hans Goudey
60390f8ac4 Cleanup: Sculpt: Pass expand cache by reference, use C++ Array 2024-08-12 22:43:47 -04:00
Hans Goudey
7e11ccc78c Cleanup: Sculpt: Use clearer variable name than "f" 2024-08-12 22:43:47 -04:00
Hans Goudey
f602492f18 Cleanup: Sculpt: Use IndexMask for expand boundary vertices 2024-08-12 22:43:47 -04:00
Harley Acheson
99a4bc325e UI: Allow Theme Coloring for Color SVG Extraction
For the times we need to obtain the bitmap of an SVG icon, send these
through the new theme coloring callback if they are multi-color. This
removes some code duplication by adding a new function that gets an
imBuf from SVG Icon. This allows, for "About" logo, Dialog icons, and
file system icons the optional ability to use a single SVG source file
that works as both monochrome (themed by text color) or multicolor with
internal parts themed.

Pull Request: https://projects.blender.org/blender/blender/pulls/126215
2024-08-13 03:31:43 +02:00
Blazer
ddc9f92777 Define fallback tooltip string for UI_UL_list items
Having the description blank for template list items when not editable
creates undo items that show as "Unknown Action." This PR ensure it has
a description whether editable or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/126184
2024-08-13 00:42:39 +02:00
Harley Acheson
e8786c7be7 UI: Icon Overlay Text Should Not Shadow if Dark
If the text color is dark then don't add shadow to the icon overlay
text - the small text showing things like user counts.

Pull Request: https://projects.blender.org/blender/blender/pulls/126247
2024-08-12 21:23:12 +02:00
Hans Goudey
4c2e5b57de Sculpt: Use new relax implementation for mesh filter
Use the relax/relax face sets implementation from
4f73bf2871 for the mesh filter.
2024-08-12 13:51:48 -04:00
Hans Goudey
00ca0e8eee Refactor: Sculpt: Share face set boundary filtering functions 2024-08-12 13:51:48 -04:00
Hans Goudey
11076b691c Cleanup: Sculpt: Small simplification in relax brush
Check the boundary corner condition outside of the
function that calculates it, and only check zero normals
when calculating them here.
2024-08-12 13:51:48 -04:00
Sean Kim
45d9bfa734 Refactor: Sculpt: Add active_vert_index() and active_vert_position()
* Adds two helper methods, the first replacing direct access to the
  PBVHVertRef i value, the second replacing the previously removed
  SCULPT_active_vertex_co_get
* Removes most trivial usage of active_vert_ref(), the remaining cases
  are a bit more complex and need separate PRs

Pull Request: https://projects.blender.org/blender/blender/pulls/126186
2024-08-12 18:57:24 +02:00
Sean Kim
cab4d6f724 Refactor: Restructure sculpt shape key updates
Pull Request: https://projects.blender.org/blender/blender/pulls/126161
2024-08-12 18:25:45 +02:00
Clément Foucault
fd7c884aef Fix: Overlay-Next: Crash on scene without active object 2024-08-12 17:24:00 +02:00
Clément Foucault
461bd0a477 Fix: Overlay-Next: Incorrect overlay_fb_draw lambda 2024-08-12 17:20:31 +02:00
Michael Kowalski
f30689e12c Fix: USD instancing export errors
Fixed two errors when exporting to USD with Instancing enabled:

Ensuring the mesh prototype prim exists before referencing it to
avoid the "Unresolved reference prim path" error messages in the
console.

Adding the Root Prim path prefix to the prototype reference path.

Pull Request: https://projects.blender.org/blender/blender/pulls/126210
2024-08-12 16:35:51 +02:00
Dalai Felinto
4b726b41b9 Outliner: Expand Geometry Nodes Modifier to show the data-block
This allow users to create a Geometry Nodes Asset directly from the Outliner.

---

Pull Request: https://projects.blender.org/blender/blender/pulls/126103
2024-08-12 15:59:09 +02:00
Hans Goudey
3d7c9a7a0b Cleanup: Sculpt: Remove unnecessary BMesh function call
This code path doesn't support BMesh which is the only
case this does anything anyway.
2024-08-12 09:45:47 -04:00
Hans Goudey
005cc72bda Cleanup: Sculpt: Remove outdated comment
The "vertex iterators" have been removed.
2024-08-12 09:45:47 -04:00
Clément Foucault
c42380c633 Overlay-Next: Outline
Straightforward port.

Only the dupli object optimization and the resource handle
deduplication are left as todos.

Marked areas that are against design to be fixed.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126152
2024-08-12 15:29:20 +02:00
Laurynas Duburas
1c70e07af5 Overlay-Next: Facing
Overlay-Next version of facing.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126153
2024-08-12 15:17:54 +02:00
Lukas Stockner
d8f550875b Fix #124038: Performance issue with color sampling in 3D Viewport
The issue here is that copying the GPU viewport back to the CPU is an expensive
operation, so doing it for every frame when dragging the eyedropper is not ideal.

Instead, copy it once at the start and keep reading from it until the user
releases the eyedropper.

Pull Request: https://projects.blender.org/blender/blender/pulls/126072
2024-08-12 14:52:28 +02:00
Sergey Sharybin
49d2184fca Cleanup: Unused variable 2024-08-12 14:14:01 +02:00
Andrej730
74c796e057 UI: Add property description for show hidden objects operator
Clarify `selection` property with description.

Pull Request: https://projects.blender.org/blender/blender/pulls/126221
2024-08-12 13:32:01 +02:00
Jesse Yurkovich
cb9ca2f7a7 Fix: USD: Write vertex crease data correctly and add tests
While adding test coverage for mesh subdivision surface scenarios, a few
problems were noticed with vertex crease support.

This PR fixes:
- Used incorrect `crease_sharpnesses` instead of `corner_sharpnesses`
- Used incorrect value for an "infinitely sharp" vertex crease
- Unnecessarily wrote out Blender's `crease_vert` attribute as a primvar

Tests are added which validate everything we support.

Pull Request: https://projects.blender.org/blender/blender/pulls/126209
2024-08-12 01:50:34 +02:00
Jesse Yurkovich
56779c7bb0 Fix: USD: Ensure mesh velocity data is written sparsely and add tests
The mesh velocity data was not using the UsdUtilsSparseValueWriter and
was writing out data for all frames even if the velocity didn't change.

Adds test coverage for this scenario as well as other situations where a
MeshSequenceCache (MSC) would be required:
- Ensures that when positions vary a MSC is added
- Ensures that when velocities vary a MSC is added (see blender/blender@c862d40e09)
- Ensures that when attributes vary a MSC is added (see blender/blender@3c394d39f2)

Pull Request: https://projects.blender.org/blender/blender/pulls/126208
2024-08-11 23:36:40 +02:00
Harley Acheson
cd998d392d UI: Color Icon Theme Internal Parts
Allow color SVG icons to have their fill colors modified by theme
colors using a callback. This is done just before rasterization so
only happens once per requested size, before these are cached for
reuse.

Pull Request: https://projects.blender.org/blender/blender/pulls/125146
2024-08-11 20:10:32 +02:00
Jacques Lucke
e842966c5e Nodes: add group node default width
This adds the ability to customize the default width of a group node that's
created for a node group. This feature works towards the goal of unifying the
features available to built-in nodes and node groups. We often customize the
width of built-in nodes from them to looks slightly better (e.g. to avoid
cut-off labels).

Pull Request: https://projects.blender.org/blender/blender/pulls/126054
2024-08-11 19:25:53 +02:00
Harley Acheson
30038f1710 UI: Allow BLF_svg_icon_bitmap to Optionally Get Multicolor Bitmap
When we draw SVG icons we have an optional argument that specifies to
treat it as multicolor. This PR allows doing the same thing when
requesting a bitmap from an icon. This is only currently done for
Dialog boxes and the About screen. The purpose of this isn't really
to allow multicolor dialog icons, but to get to the point where a
single SVG source file could be used as monochrome (changing the one
color with text color) or multi-color (changing internal colors with
themes) without needing multiple copies of the source file

Pull Request: https://projects.blender.org/blender/blender/pulls/126193
2024-08-11 05:07:35 +02:00
Harley Acheson
c3377a3498 UI: Improved Gray scale Values for Rendered SVG Bitmaps
This PR corrects some mistakes in the conversion between RGBA bitmaps
created when rasterizing SVG icons and the monochrome coverage maps
when displaying these in a single color. This only occurs when we need
a bitmap from an icon for About screen and for dialogs. The bitmap
from NanoSVG is already premultiplied so don't do it again.  When
converting from coverage map to RGBA use map value for all components
rather than FFF for colors. When converting to coverage map from RGBA
use perceptual grayscale level of color, not just alpha value.

Pull Request: https://projects.blender.org/blender/blender/pulls/126192
2024-08-11 03:12:20 +02:00
Bastien Montagne
1c98cdbc52 Refactor: UI_list: Move PointerRNA containers to C++ code.
Essentially replace a C-managed allocated array by a `blender::Vector`.

Part of on-going effort to make PointerRNA an actual non-trivial C++
struct (see !123435 and #122431).

Pull Request: https://projects.blender.org/blender/blender/pulls/126100
2024-08-10 17:51:41 +02:00
Clément FOUCAULT
1c1af5383b Overlay-Next: Enable prepass only if selection and xray are off 2024-08-10 10:44:27 +02:00
Jesse Yurkovich
ef2e1f8423 Fix #126160: Incorrect string returned from usd::make_safe_name
When a multi-byte character needed to be turned into a single "_", the
final returned string would be too large in size.

Resize it to the exact number of bytes required and add test coverage.

Pull Request: https://projects.blender.org/blender/blender/pulls/126164
2024-08-10 05:59:05 +02:00
Campbell Barton
7e80bfaa62 Cleanup: follow naming convention for source lists
The cmake checking utility uses this to know which lists should be
scanned for souces.
2024-08-10 11:32:46 +10:00
Campbell Barton
b1be5b15c4 Cleanup: various non functional changes
Remove struct, use string copy macros.
2024-08-10 11:32:43 +10:00
Campbell Barton
0bc5b3f70e Cleanup: remove redundant checks 2024-08-10 11:32:42 +10:00
Campbell Barton
34d12ab33a Cleanup: consistent naming for icon/icon_id 2024-08-10 11:32:40 +10:00
Campbell Barton
06df1dab8b Cleanup: use const args & vars 2024-08-10 11:32:39 +10:00
Campbell Barton
fe3c6ef448 Cleanup: spelling in comments 2024-08-10 11:32:37 +10:00
Sean Kim
52a0d4252e Refactor: Sculpt: Create per-pbvh topology automasking initialization
Pull Request: https://projects.blender.org/blender/blender/pulls/126110
2024-08-10 02:15:41 +02:00
Hans Goudey
12aa569f6e Cleanup: Remove now unused PBVH vertex iteration macro
Part of #118145.
2024-08-09 17:33:04 -04:00
Hans Goudey
391ebb603c Sculpt: Refactor for pose brush factors creation
Part of #118145.
2024-08-09 17:33:04 -04:00
Sean Kim
810fee35f3 Fix #126074: Sculping on a non-basis shape key modifies mesh
This commit prevents writing to the mesh when sculpting on a non-basis
shape key. Prior to this, we incorrectly were applying changes to the
base mesh, even though those changes were not visible with the shape
keys still active, causing new shape keys to have a copy of the deformed
mesh data.

Pull Request: https://projects.blender.org/blender/blender/pulls/126107
2024-08-09 22:34:25 +02:00
Hans Goudey
ae13fb5a53 Refactor: Sculpt: Various cleanups in relax brush
- Use `Vector::remove_if` rather than custom "filter" functions copying
  data to new vectors.
- Pass `float3` by const reference.
- Reorder arguments to pass constant/operation-global arguments first,
  also using consistent order for mesh data arrays.
- Use const for some `Object` arguments.
- Initialize zero `float3` in a simpler way.
- Simplify neighbor averaging by checking for empty vectors first.
- Use more standard grids index variable names
- Remove `BLI_NOINLINE` from functions called for every element, more
  consistent usage in general.

Pull Request: https://projects.blender.org/blender/blender/pulls/126145
2024-08-09 21:37:58 +02:00
Philipp Oeser
3e5751c726 Fix: Animation Editors Dopesheet RNA paths incomplete/wrong
Somewhat similar to !125365, !126035 and !125963 (but more specialized
for Dopesheet), this PR adds the missing "areas[x].spaces[x]" subpath to
an Animation Editor (Graph, Dopesheet, NLA) `Dopesheet` struct and its
properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/126132
2024-08-09 20:00:15 +02:00
Hans Goudey
4349d6b766 Fix #126101: Crash with lines generated by geometry nodes grid node
The grid geometry creation incorrectly tagged the mesh with no loose edges
or vertices, breaking invariants of the caches that are relied on elsewhere.
2024-08-09 13:49:06 -04:00
Jesse Yurkovich
3c394d39f2 Fix: USD: Write sparse attribute data correctly
The common code which writes out attribute data was seemingly not
performing the right sequence of calls for the UsdUtilsSparseValueWriter
to actually write sparse data.

See PR for a test file and .usda files produced with 4.1 and now with
this change applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/126113
2024-08-09 19:48:52 +02:00
Jesse Yurkovich
5835ea1eaf Build: C++20: Properly implement some definitions of operator==
Several `operator==` methods were mis-implemented; they were not defined
as `const` when implemented as part of the class rather than as friends.
C++20 is more strict about this now.

Example errors: https://godbolt.org/z/h8G5jaoha

Ref #125881

Pull Request: https://projects.blender.org/blender/blender/pulls/126121
2024-08-09 19:48:05 +02:00
Jesse Yurkovich
67eef274ee Build: C++20: Replace the removed std::shared_ptr::unique API
C++20 removes the `std::shared_ptr::unique()` API with the suggestion to
use the `use_count()` method instead.

Note that we are using the unique/use_count APIs in a way that is
generally cautioned against though our usage patterns may be fine.

See: https://en.cppreference.com/w/cpp/memory/shared_ptr/unique
Example errors: https://godbolt.org/z/1j3zzd1hP

Ref #125881

Pull Request: https://projects.blender.org/blender/blender/pulls/126120
2024-08-09 19:47:29 +02:00
Clément Foucault
4d17c674af Overlay-Next: Add debug group to edit mesh 2024-08-09 19:20:59 +02:00
Falk David
e2ade82b41 Annotations: Revert removal of some API functions
These were removed by cc28ad8dcf
but shouldn't have been.

Since these are used by some addons to e.g. add new
annotation layers, it's better to keep them around.

Pull Request: https://projects.blender.org/blender/blender/pulls/126096
2024-08-09 17:28:30 +02:00