Commit Graph

120055 Commits

Author SHA1 Message Date
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
Falk David
942499382d GPv3: Vertex Paint Mode
This adds the vertex paint mode and all of the tools
from GPv2:
 * Average
 * Blur
 * Draw
 * Replace
 * Smear

Pull Request: https://projects.blender.org/blender/blender/pulls/125674
2024-09-10 18:56:31 +02:00
Sybren A. Stüvel
d30582cc56 Refactor: remove incorrect forward declaration of struct Action
Remove the forward declaration of `struct Action` from
`DNA_constraint_types.h`. That struct hasn't existed in a long time.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127419
2024-09-10 17:55:58 +02:00
Sybren A. Stüvel
c4c8c46968 Refactor: fix wrong struct typedef name in DNA_action_types
Fix `typedef struct ActionChannelBag { ... } ChannelBag;` so that the
'typedef name' is also `ActionChannelBag`.

Note that this does _not_ change the struct name in DNA. It's purely for
the naming in our code.

No functional changes.
2024-09-10 17:55:57 +02:00
Lukas Tönne
81fdae07ef Fix #125922: GPv3 interpolate tool copies curve attributes as well
Interpolate tool was only mixing point attributes, leaving the
output curves without most curve attributes. Now the interpolate_curves
functions actually copy or mix curve attributes as well.

Only float-based attributes are interpolated for now to avoid
meaningless values for material indices, boolean flags, etc. Other
attribute types are simply copied from the first curve in each pair.

Pull Request: https://projects.blender.org/blender/blender/pulls/127350
2024-09-10 17:53:23 +02:00
Pratik Borhade
5a9b1ddb6c Cleanup: Curves: Store first/last stroke point in variable
Store `points.first()/last()` in a variable to prevent multiple calls to
range function. Also discussed in !126591.

Pull Request: https://projects.blender.org/blender/blender/pulls/127344
2024-09-10 15:16:04 +02:00
Sybren A. Stüvel
3fdc9e9637 Refactor: convert BKE_action.h to C++
Move the contents of `BKE_action.h` into `BKE_action.hh` and remove
C-isms.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127407
2024-09-10 14:55:47 +02:00
Sybren A. Stüvel
3ca0b4fc4d Anim: clarify 'disabled' message for bone collection operations
Clarify the 'disabled' message in the tooltip for certain bone collection
operations. They now tell you to create an override "on the Armature Data",
and not just "on the Armature". This should clarify that it's not enough
to create an override on the armature Object.

Pull Request: https://projects.blender.org/blender/blender/pulls/127405
2024-09-10 14:36:25 +02:00
Sybren A. Stüvel
636d83fbea Refactor: convert BKE_nla.h to C++
Rename `BKE_nla.h` to `BKE_nla.hh` and remove C-isms.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/127395
2024-09-10 13:41:01 +02:00
YimingWu
06e70e7bc0 GPv3: Implement Grease Pencil to mesh conversion
Support Object > Convert > Mesh option for grease pencil v3.
This does the conversion by first converting it into Curves then use the
same routine to convert Curves into Mesh wires.

Pull Request: https://projects.blender.org/blender/blender/pulls/123835
2024-09-10 13:36:31 +02:00
Aras Pranckevicius
4556624edd VSE: Draw thumbnails in timeline by default
Now that thumbnails are faster to load and less flicker-y (#126405), and faster to draw in the timeline (#126972), they can be enabled by default.

Existing files continue to use their current setting.

Pull Request: https://projects.blender.org/blender/blender/pulls/127403
2024-09-10 13:01:24 +02:00
Iliya Katueshenock
957330043f Refactor: Attributes: support different source and destination domains in propagation utilities
Pull Request: https://projects.blender.org/blender/blender/pulls/127026
2024-09-10 12:59:03 +02:00
YimingWu
168c568058 Fix #126946: GPv3: Handle erase mode when using a tablet pen
Pressing ctrl-click should switch the drawing tool into a eraser
for grease pencil. This is now handled by detecting
`EVT_TABLET_ERASER` and switch to `BRUSH_STROKE_ERASE` mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/126962
2024-09-10 11:59:08 +02:00
Jeroen Bakker
59fa82118e Vulkan: Blendfile thumbnail generation
Vulkan would crash when generating a thumbnail in case there is no
3D viewport in the active workspace. When this happens the front buffer
is downscaled as thumbnail. We didn't create a front buffer as swap
chains are handled differently.

We work around this issue in the same way as Metal does. Create a dummy
front framebuffer and share the surface texture. When the thumbnail
generator reads from the front buffer it will read the data that was
created by the back buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/127393
2024-09-10 11:02:43 +02:00
Sybren A. Stüvel
ed0cfe7312 Anim: fix crash drawing Action groups when built without Action Slots
Fix a crash that happens when drawing Action groups in the dope sheet, when
Blender is built without experimental features (hence without Action
slots) and it has loaded a blend file with slotted Actions.

Basically a pointer needs to be set to `nullptr` when reading such a file,
as it ensures that the rest of the code treats the group as "from a legacy
Action".

Pull Request: https://projects.blender.org/blender/blender/pulls/127339
2024-09-10 10:59:29 +02:00
Jeroen Bakker
e22fc36fd5 Vulkan: Incorrect selection in edit mode
Edit mode selection returns incorrect indices. The reason is
that the extent of the area downloaded to the CPU for evaluation was
incorrect and read pixels could not in the place where they are
actually stored.

Was an oversight when fixing face selection. It wasn't that noticeable
there as faces typically cover a larger space.

Pull Request: https://projects.blender.org/blender/blender/pulls/127386
2024-09-10 10:58:37 +02:00
Campbell Barton
c702e42f92 Cleanup: code-comments in smooth-view 2024-09-10 18:57:18 +10:00
Campbell Barton
884d882155 Cleanup: track the "changed" state when exiting local-view
Previously it was assumed that exiting the local-view succeeded
even when nothing was changed.

Now VIEW3D_OT_localview doesn't perform any updates
when existing the local view does nothing.
2024-09-10 17:31:12 +10:00
Campbell Barton
3ad14a6fc0 Viewport: use the smooth-view preference when refreshing
Replace hard coded value with a preference to match other smooth-view
operations, making it possible to disable smooth-view.
2024-09-10 17:31:08 +10:00
Campbell Barton
2593fffa4d Fix local view failing to restore axis-roll
Entering local-view, then setting an axis via the num-pad and exiting
local view would restore the original axis but not the axis-roll.

Store the axis-roll for local-view & smooth-view operations.
2024-09-10 17:31:06 +10:00
Campbell Barton
d122d19f00 Fix missing redraw when setting the view axis
When the viewport orientation matched the view axis,
setting an axis view didn't redraw the region.

This caused the viewport text & grid not to update.
2024-09-10 17:31:05 +10:00
Campbell Barton
9d6ecd0ed6 Fix local view toggle setting the view to "User"
Activating local view could set an axis view to "User"
when activated before the previous action had completed.
2024-09-10 17:31:04 +10:00
Campbell Barton
62dbebc18e Cleanup: pass const depsgraph for viewport funcitons 2024-09-10 17:31:02 +10:00
Harley Acheson
565f9f6b8a UI: Do Not Allow Docking into Temp Windows
Do not allow dragging screen areas into Temp windows, like Properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/127379
2024-09-10 02:43:07 +02:00