Commit Graph

112928 Commits

Author SHA1 Message Date
Aras Pranckevicius
c41bb20008 Fix #124549: can't customize overlay text color
Improvements to how text colors and shadows are determined for the
3D View overlays. Starting with the theme's text highlight color, it
is lightened or darkened if necessary to give contrast with the
background. Then a black or white shadow is used depending on text
color.

Pull Request: https://projects.blender.org/blender/blender/pulls/127389
2024-09-12 04:24:53 +02:00
Aras Pranckevicius
1bf1ad8e52 Fix: VSE framerate text color is not visible unless it is too slow
When playback framerate is too slow, then text was red and visible.
Otherwise it was black text on normally black background though, which
is not very useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/127394
2024-09-12 03:01:05 +02:00
Sean Kim
8b3794514b Fix #127279: Various brushes do not work on multires
Introduced with 347ec1acd7.

Various brushes use the `calc_area_normal_and_center_node_grids`
function to determine their displacment. Prior to this commit, the
calculation of this plane normal was not iterating over the `IndexMask`
correctly.

This manifested on the default cube at multires levels greater than 6,
because at that point the number of PBVH nodes was greater than 1,
leading to the wrong nodes being used to calculate this effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/127474
2024-09-12 01:46:12 +02:00
Harley Acheson
4d88c18e8b UI: Don't Show Drag Cursors on Non-Floating Menus
PR ##127465 accidentally removed a check for is_floating, which means
that you get a drag cursor near the top of dropdown menus. This fixes
that dumb mistake.

Pull Request: https://projects.blender.org/blender/blender/pulls/127472
2024-09-11 23:41:58 +02:00
Hans Goudey
b2d201cbea Cleanup: Remove outdated SubdivCCG masks assert
Missed in 1618448abd.
2024-09-11 16:35:14 -04:00
Hans Goudey
2fc82f8f3f Cleanup: Sculpt: Specialize face sets automasking precalculation
Part of #118145.
2024-09-11 16:08:48 -04:00
Hans Goudey
8d08701a68 Cleanup: Tweaks to SubdivCCG range utilities
Allow retrieving a face's range without a CCGKey
2024-09-11 16:08:27 -04:00
Jesse Yurkovich
cbdc7d7636 Cleanup: Remove old USD version guards
Remove old version guards relating to USD versions prior to 2111 which
released in Nov 2021.

The oldest supported version of Blender, 3.3 LTS which goes end of life
this month, was already using USD version 2203 released in March 2022.
Additionally, these guards give the illusion that compiling with old
versions prior to 2111 might work, which is neither guaranteed nor
tested for at this point.

Pull Request: https://projects.blender.org/blender/blender/pulls/127380
2024-09-11 21:45:22 +02:00
Sean Kim
86c3ca0914 Fix: Crash when canceling expand operator
Pull Request: https://projects.blender.org/blender/blender/pulls/127430
2024-09-11 21:38:59 +02:00
Harley Acheson
0c1d8ad8a5 UI: Status Bar During Non-Operator UI Interaction
This PR clears the status bar when popovers, confirmations, and dialogs
open. Also while editing text, entering numbers, or dragging on sliders

Pull Request: https://projects.blender.org/blender/blender/pulls/127005
2024-09-11 21:02:39 +02:00
Harley Acheson
442fd1925e Fix #127438: Don't Show Menu Drag Cursor Over Content
Some popup menus have content at the very top, within the title bounds.
In this case don't show the drag cursor if there is a button under the
mouse location.

Pull Request: https://projects.blender.org/blender/blender/pulls/127465
2024-09-11 20:26:02 +02:00
Hans Goudey
2a0c332776 Fix: Sculpt automask occlusion crash 2024-09-11 13:50:23 -04:00
Sean Kim
ab5ce3061a Fix #127357: Expand operator crashes when cursor is not on mesh
Prior to 0df133559c, the `active_vert_` property was only ever
invalidated if the entire `SculptSession` was refreshed, even if the
cursor moved off of the mesh or if the underlying mesh type changed.

The Sculpt Expand operator was dependent on this value not being cleared
to still behave in a reasonable way from a user perspective

This commit introduces a new variable, `last_active_vert_` and
corresponding accessor methods to `SculptSession` to specifically fix
this usecase. When the active vert is cleared, if it had a valid value,
we store it in the new `last_active_vert_` variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/127433
2024-09-11 19:48:31 +02:00
Hans Goudey
f1f0f2daaa Refactor: Sculpt: Move cached automask factor out of attribute system
Part of #118145.
The attribute system should be used to store user-edited data, not
temporary caches during a stroke. It's simpler and more obvious to
just store this as part of the cache created for every brush stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/127463
2024-09-11 19:25:13 +02:00
Sean Kim
be4205b824 Fix #127396: Invert Mask doesn't apply to entire mesh
Missed in 347ec1acd7

Pull Request: https://projects.blender.org/blender/blender/pulls/127435
2024-09-11 19:16:58 +02:00
Clément Foucault
b4005b73ba Overlay-Next: UV: Fix facedots affected by object matrix 2024-09-11 18:52:12 +02:00
Clément Foucault
8b66d65c44 Cleanup: Overlay-Next: Remove enum keyword in front of enum types 2024-09-11 18:51:10 +02:00
Clément Foucault
f0742d2a42 Overlay-Next: Fix broken shaders 2024-09-11 18:51:10 +02:00
Hans Goudey
71578879b9 Refactor: Sculpt: Simplify automask stroke ID update
Replace the convoluted "automasking end" pattern with a
function that actually says what it does in its name.
2024-09-11 12:40:20 -04:00
Hans Goudey
bf12274d5e Cleanup: Sculpt: Pass automasking by const reference
Part of #118145.
2024-09-11 12:40:20 -04:00
Clément Foucault
79e7749557 Overlay-Next: Add DebugScope for selection and drawing
Allows to selectively capture between
- selection drawing
or
- viewport drawing.
2024-09-11 18:37:44 +02:00
Clément Foucault
4021a517a8 GPU: Add DebugScope class
This class allows to define capture scopes
that can be chosen during gpu work capture.

This reduces the amount of command captured
and allow for faster replay and easier
navigation inside the debug tools like Xcode
or RenderDoc.
2024-09-11 18:37:42 +02:00
Clément Foucault
7f559799e1 Overlay-Next: Fix compilation error after merge 2024-09-11 18:37:37 +02:00
Clément Foucault
c82ddedb9b Overlay-Next: Image Space
Port all Image editor overlays.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127366
2024-09-11 18:26:34 +02:00
Laurynas Duburas
bae268c57f Overlay-Next: Grid 2D
Overlay-Next version of Grid 2D

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127285
2024-09-11 18:10:00 +02:00
Aras Pranckevicius
30dbb7820d Cleanup: VSE effects never have 3 inputs, remove seq3 handling
"seq3" input for VSE effect strips has been there ever since
"initial revision" commit in 2002, with comment "pointers voor effecten"
even. But it has never been used, so remove all code that pretends
to do something with it.

Pull Request: https://projects.blender.org/blender/blender/pulls/127401
2024-09-11 17:56:22 +02:00
Laurynas Duburas
30724ddecd Overlay-Next: Fade
Overlay-Next version of  Fade in Mesh edit mode and Fade geometry in armature pose mode.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/127247
2024-09-11 17:29:26 +02:00
Jacques Lucke
7fc7462890 Fix #127448: mesh boolean node stops gizmos from working
The issue is that the boolean node did not propagate edit data and thus lost
information about gizmos. Now the boolean node propagates edit data from
all geometry inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/127457
2024-09-11 17:20:51 +02:00
Miguel Pozo
a602e5530a Fix #127437: Crash with parallel shader compilation
Avoid race conditions and handle pending async compilations
when compiling synchronously.
2024-09-11 16:34:57 +02:00
Jacques Lucke
8182f684be Fix #127054: crash due to integer overflow in Resample Curves node
This adds a variant of `accumulate_counts_to_offsets` which checks for
overflows. The hot loop stays essentially the same, it just uses a `int64_t`
instead of `int` for the counter now. For now the error state is returned by
using an `std::optional`. Alternatives could be to throw `std::overflow_error`
or to use some Result/Expected type in the future.

Obviously, there are more places that should handle this kind of error. It's
also not obvious how to propagate that error further up yet so that we can
display e.g. a warning in the node. That decision should be applicable to other
nodes too. For now, there is no warning on the node.

Pull Request: https://projects.blender.org/blender/blender/pulls/127184
2024-09-11 16:12:47 +02:00
Hans Goudey
1618448abd Sculpt: Store multires grids data in separate arrays
For `SubdivCCG`, replace the dynamic array-of-struct data with separate
arrays for positions, normals, and masks. This decreases memory
bandwidth requirements for loops that only access one of these arrays.
It also significantly simplifies data access, making it more similar
to mesh data where it can just be accessed with indices.

In a simple test this change speeds up the multires sculpt brush
benchmark by 32%. It also slightly reduced BVH build time by about 12%.

In practice this means completely replacing usage of `CCGElem` for
`SubdivCCG`. The struct is still used in the older subsurf baking code
though. Removing that is a much trickier task that doesn't have short
term benefits.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/127262
2024-09-11 15:54:46 +02:00
Jacques Lucke
4c2718e318 Fix #126821: compress saving option gets removed when recovering from autosave
Before efb511a76d this was not necessary, because the G_FILE_COMPRESS option
was not disabled when writing memfile undo steps. However, compression is
generally disabled when writing quit.blend or autosave files.
2024-09-11 15:11:42 +02:00
Jacques Lucke
e18aa65973 Fix: quit.blend is not saved as recovery file
This was broken in efb511a76d. The memfile-undo step always had
this flag set, but the non-memfile file-write did not.
2024-09-11 14:38:04 +02:00
Jacques Lucke
2d93671778 Fix: unnecessary node updates
It looks like the check introduced in e071288ab2 is the
wrong way around.

Pull Request: https://projects.blender.org/blender/blender/pulls/127426
2024-09-11 13:59:16 +02:00
Philipp Oeser
d7bdfe39a3 Fix: Movieclip Editor opening a file mem allocation mismatch
Oversight in 9506fed905

This would give: "Attempt to use C-style MEM_freeN on a pointer created
with CPP-style MEM_new" (and crash in my local builds)

Pull Request: https://projects.blender.org/blender/blender/pulls/127347
2024-09-11 13:29:57 +02:00
Aras Pranckevicius
78972f8559 Fix #127192: VSE Tonemap now works as expected on strips that don't cover whole screen
When doing average/min/max luminance calculations for tonemapping, ignore
pixels that are outside of the strip rectangle. Due to how VSE innards work,
when a strip is positioned to not cover the whole screen, "the rest" is filled
with transparent black. For tonemapping, this was dragging average calculated
luminance way down.

Images of the issue in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/127207
2024-09-11 12:42:03 +02:00
Aras Pranckevicius
3af3c94ec6 ImBuf: Avoid redundant memory clears when loading EXR images
When loading an EXR image, first we were allocating memory for it,
then clearing it to zero, then using OpenEXR to load the data. But
the process of loading will overwrite all the pixel values anyway,
so it is pointless to do the first clear.

On a test VSE file that has two 1920x1080 EXR image sequences blended
together, plus some color correction on top, playback framerate of it:

- PC: 12.6 -> 13.2 FPS (Ryzen 5950X, RAM bandwidth ~32GB/s)
- Mac: 27.3 -> 29.5 FPS (M1 Max, RAM bandwidth ~400GB/s)

Pull Request: https://projects.blender.org/blender/blender/pulls/127427
2024-09-11 12:38:31 +02:00
Aras Pranckevicius
0d9b793dfa VSE: Multi-thread Saturation and Multiply strip color controls
Image/movie strip controls color controls: "Saturation" and "Multiply" were
both single-threaded code. Multi-thread both of them. Timings to apply them
on a 4K resolution byte image, on Ryzen 5950X (Win10/VS2022):

- Saturation: 97ms -> 6.3ms
- Multiply: 11.5ms -> 1.1ms

Pull Request: https://projects.blender.org/blender/blender/pulls/127409
2024-09-11 12:37:50 +02:00
Sergey Sharybin
a9208e9f8e Fix #126825: Crash on duplicating child collection of liboverride hierarchy
Pass CollectionChild explicitly, so the duplication code is not confused
about where the to copy light linking settings from.

Pull Request: https://projects.blender.org/blender/blender/pulls/127237
2024-09-11 11:19:23 +02:00
Campbell Barton
e00fed43e6 Cleanup: redundant struct declarations 2024-09-11 16:25:25 +10:00
Pratik Borhade
a8137e62c6 Fix #127382: Area docking crash with Action editor
Crash triggered due to null string (index is -1).
Problem and fix both are similar as !126584

Pull Request: https://projects.blender.org/blender/blender/pulls/127402
2024-09-10 23:29:30 +02:00
Hans Goudey
853269aeb0 Sculpt: Make multires BVH build similar to mesh
Structure the multires grids PBVH build to be similar to meshes,
splitting face indices into groups instead of grid indices. This
removes one step of indexing, decreases the amount of temporary
data, and allows sharing the majority of the implementation with
the mesh BVH build.

In a test file with 4 million faces at multires level 1, this reduced
BVH build time from 149 to 70 ms. The improvement will be
significantly lower for higher subdivision levels.

Pull Request: https://projects.blender.org/blender/blender/pulls/127429
2024-09-10 22:46:04 +02:00
Iliya Katueshenock
0b7090ca37 BKE: Utilities to create curves and point clouds without attributes
Same as #118297.

Pull Request: https://projects.blender.org/blender/blender/pulls/120368
2024-09-10 21:48:59 +02:00
Hans Goudey
a4b42daf80 Refactor: Sculpt: General cleanups to ensure PBVH function 2024-09-10 15:39:03 -04:00
Hans Goudey
7cd6b7175f Sculpt: Parallelize max face size reduction during grid BVH build 2024-09-10 15:29:53 -04:00
Hans Goudey
883568c0b1 Cleanup: Improve face size variable name 2024-09-10 15:29:53 -04:00
Hans Goudey
8cd80b0fac Cleanup: Correct comment and add note
I think the limit is unnecessary because I can't think of a good
reason for it and there is no reasoning in the git history.
2024-09-10 15:29:53 -04:00
Sean Kim
b748cf316f Fix: GPv3: Avoid NaN when reprojecting
Missed in https://projects.blender.org/blender/blender/pulls/126255

The `placement_loc_` variable was not initialized if using an axis
`ReprojectMode`. Also sets the `DrawingPlacementDepth` mode correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/126621
2024-09-10 21:28:26 +02:00
Hans Goudey
5d429bb063 Fix #127400: Sculpt mode drawing uses wrong version of color attribute 2024-09-10 14:55:25 -04:00
Lukas Tönne
488b5cda54 Fix: GPv3 interpolation tool incorrect point count
The interpolation tool computes the point count of output curves as the
maximum of each curve pair. The pairs are ordered by to/from frame
numbers. The point counts were stored in the "original" pair order, so
curve density could be quite incorrect.

Pull Request: https://projects.blender.org/blender/blender/pulls/127353
2024-09-10 19:35:10 +02:00