Commit Graph

111796 Commits

Author SHA1 Message Date
Julian Eisel
3ec3704af6 Cleanup: Remove unused header in asset system header 2024-07-26 12:52:25 +02:00
Julian Eisel
28539c7dcf Refactor: Assets: Remove unnecessary asset storage class
This was just a useless level of abstraction, where the asset library
would have functions with the same name, just to pass the call on to the
asset storage. Now asset library stores and manages the asset
representations itself directly.

This should simplify the asset system a bit. I heard from other devs
that these kind of helper classes caused confusion for them.
2024-07-26 12:52:25 +02:00
Bastien Montagne
536fb53dc6 Core: Blendfile Write: Check against multiple writing at same address.
Blendfile uses the 'old (memory) address' of its data as 'uid' in the
blendfile. There should only be one block written for a given address
and a same ID (each ID define its own 'virtual address space').

This commit checks that this condition is met at wrtite time (except for
undo steps, for performances reasons).

Tooling part of the investigations on #125001.
2024-07-26 12:40:25 +02:00
Julian Eisel
2100623a96 Refactor: UI: Use unique_ptr for tooltip data management
Mostly to allow leak-free early exiting from functions generating the
tooltip data, otherwise cleanups have to be duplicated. But using smart
pointers is good practice in general. Also use references instead of
pointers, to indicate that null is not an expected value.
2024-07-26 12:31:01 +02:00
Casey Bianco-Davis
ddbc34829f GPv3: Initial transform operator support for bezier handles
This adds initial support for transforming bezier handles.
In some cases, the pivot is not correct, e.g. when scaling or rotating
one left or right handle. This will be added in a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/123110
2024-07-26 12:24:04 +02:00
Casey Bianco-Davis
e864cb0614 GPv3: Bezier handles selection in pick operator
This modifies the Grease Pencil `pick` selection operator to use bezier handles as points to be selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/125398
2024-07-26 12:19:10 +02:00
Lukas Tönne
9afe70968d GPv3: Fill tool: Hide extension circles when adding lines
The "radius" mode shows circles for the radius in which new lines are
formed. However, all circles currently remain visible when a point is
found in the circumference. This patch removes circles once they add
a line.

Followup fix for #125229.

Pull Request: https://projects.blender.org/blender/blender/pulls/125475
2024-07-26 11:40:20 +02:00
Sergey Sharybin
3ae945c34a Cleanup: Strict compiler warnings
Happens in release builds or when GPU_FORCE_ENABLE_SHADER_PRINTF=1.
2024-07-26 11:29:50 +02:00
Sybren A. Stüvel
c7bf1a697e Anim: forward compatibility for F-Curves in layered Actions
When writing a layered Action to disk, take the F-Curves from the
first keyframe strip and write that as `action.curves` as well. This
will make older Blender versions see those curves and load them
properly.

Only the curves for the first slot are written this way. This means
that any legacy Action that was converted to a layered Action will be
loaded again properly by older Blender versions. Of course this is
limited to a single layer, single strip, and single slot -- once the
newer features are used, older versions of Blender will not be able to
see this extra data.

When an Action contains multiple slots, so with animation for multiple
distinct objects, the forward compatibility becomes a bit iffy. Older
versions of Blender will just see a legacy Action, with its legacy
semantics, and thus all objects that use that Action will receive the
exact same animation data. I don't think there's a way around this.
(_Unless we start breaking up Actions into an Action per slot, alter
the assignments, and then store metadata so that modern Blenders can
reassemble them. I do not think this is a good idea._)

Ref: #124714

Pull Request: https://projects.blender.org/blender/blender/pulls/125065
2024-07-26 11:13:40 +02:00
Aras Pranckevicius
160f27330f Fix #124922: VSE text strip shadow now casts shadow of the outline
As well as takes text color transparency into account. That is, text
"shadow" now virtually casts shadow of however the text itself + outline
looks like. The result is blurred, and extra shadow color tint and
transparency is applied.

Performance testing: seems to be slightly faster than before in my tests.
Probably because the shadow "image" that is now blurred only contains
one byte per pixel (the transparency), instead of full uchar4 per pixel
(with only the "transparency" being blurred).

I have extended sequencer render tests to better cover various text
outline/shadow/box combinations.

Pull Request: https://projects.blender.org/blender/blender/pulls/125445
2024-07-26 10:49:10 +02:00
Omar Emara
945f7f5e23 Fix: Grease Pencil not visible when using compositor
Grease Pencil objects are not visible when using the viewport
compositor. That's because since the introduction of multi-pass
compositing, the compositor now access the combined pass written by
EEVEE, which does not include GP.

To fix this, we skip writing the EEVEE combined pass, then read the
viewport texture for the combined pass as a special case, which should
include GP.
2024-07-26 10:31:29 +03:00
Philipp Oeser
09cb2be159 Fix #124444: Painting from python ignores certain brush features
The reported issue was that Texture Mask mapping behaves wrong (wrong
coordinates -- seemed as if it was always using `Tiled` mapping), but
the issue actually spawns to more brush features (the coordinates were
wrong not only for mask mapping but for the actual texture mapping, too,
next to randomness and offsets/angles being ignored, jitter was also not
working at all).

On the code side, for the reported issue, we can observe that
`BKE_brush_sample_masktex` relies on `UnifiedPaintSettings`
`mask_tex_mouse` to be set. Other stuff mentioned above also ends up in
`UnifiedPaintSettings`.

In regular painting (has its own modal), this gets updated in
`paint_brush_stroke_add_step` by calling `paint_brush_update` before
adding another step. This is not called when doing painting from python
(here the modal handling happens in py, usually
`bpy.ops.paint.image_paint`is executed immediately for each mousemove).

Jitter is also doing stuff in `paint_brush_stroke_add_step` -- equally
ignored from above py workflow.

So to resolve, now make sure we are calling the necessary stuff in
`paint_exec` as well.

NOTE: There was a similar case in
9aa20a0979, where we could simply move
part of the necessary code from `paint_brush_update` to
`paint_stroke_new`

NOTE: `Rake` is still ignored, depends on previous positions, cannot be
supported

Pull Request: https://projects.blender.org/blender/blender/pulls/124582
2024-07-26 08:36:13 +02:00
Campbell Barton
656fe6d3e4 Extensions: support "blocklist" in the remote repository
Support blocking extensions so there is a way for the maintainers of
the remote repository to notify the user if one of their installed
extensions blocked along with a reason for blocking.

Blocked extensions cannot be installed from the preferences or by
dropping a URL.

When an installed & blocked extension is found:

- An icon int the status bar shows an alert,
  clicking on the icon shows the blocked extensions.
- The extensions preferences show a warning.
- The extensions & add-ons UI shows an alert icon
  and "details" section shows the reason.

Details:

- Blocked & installed extensions are shown first in the installed
  extensions panel.
- The internal "install" logic prevents downloading & installing
  blocked extensions.
- Blocked extensions can still be downloaded & installed from disk.
- The "list" command includes an error message if any installed
  extensions are blocked.
- The "server-generate" command can optionally take a configuration
  file that includes the blocklist for the generated JSON.

See design #124954.
2024-07-26 16:05:34 +10:00
Hans Goudey
437cb33a73 Refactor: Sculpt: Use new mesh vertex neighbor function
Use for voxel detail size sample, paint smearing, and
interior vertex neighbor calculation.
2024-07-26 00:19:32 -04:00
Hans Goudey
ce0f51ac1b Cleanup: Sculpt: Use enum class in various places 2024-07-26 00:19:16 -04:00
Hans Goudey
806ce8ebe3 Sculpt: Data oriented refactor for color filter tool
Part of #118145.
Move the operation switch out of the hot loop.
Use a series of thread local arrays to split some loops into simpler parts.
2024-07-26 00:19:16 -04:00
Hans Goudey
5f168b9ff6 Refactor: Sculpt: Use newer structure for color filter factors
Part of #118145.
2024-07-26 00:00:49 -04:00
Hans Goudey
70a72ca483 Sculpt: Refactor for color filter pre-smoothing
Part of #118145.
The pass was completely single threaded before, it's no parallelized.
2024-07-26 00:00:49 -04:00
Sean Kim
31e636a29e Refactor: Reorganize sculpt_boundary.cc calculations
* Moves boundary initialization out of indices_init
* Change parameters for edit_data_init since all it needs is the index
* Revert change to queues to use PBVHVertRef again since the newly
  refactored code will have to use int / SubdivCCGCoord / BMVert* for
  neighbor processing anyways
* Reduce scope of some variables
* Reduce nested branching

Pull Request: https://projects.blender.org/blender/blender/pulls/125390
2024-07-26 06:00:25 +02:00
Sean Kim
8d454ba13f Sculpt: Add vert_neighbors_get_mesh method
Note, this doesn't expose a similar method for grids due to
BKE_subdiv_ccg_neighbor_coords_get.

Pull Request: https://projects.blender.org/blender/blender/pulls/125470
2024-07-26 05:54:58 +02:00
Sean Kim
6568629520 SubdivCCG: Add to_index helper method
This commit adds a method to compute the position of a given
SubdivCCGCoord in an appropriately sized array.

Pull Request: https://projects.blender.org/blender/blender/pulls/125462
2024-07-26 04:35:34 +02:00
Campbell Barton
12a6cefe1a Cleanup: remove redundant theme color lookup 2024-07-26 10:24:36 +10:00
Sean Kim
d5617d5a2b Cleanup: Remove unnecessary const parameters for vert_is_boundary
* Also removes extra duplicated function declaration.

Pull Request: https://projects.blender.org/blender/blender/pulls/125461
2024-07-26 01:05:09 +02:00
Hans Goudey
e17177c7e3 Cleanup: Decrease RNA enum items array scope 2024-07-25 15:37:49 -04:00
Hans Goudey
1076564070 UI: Sculpt mesh filter status display
Show icons in the status bar instead of raw text.
2024-07-25 15:36:33 -04:00
Hans Goudey
0205db4f03 Sculpt: Data oriented refactor for surface smooth brush
Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/125394
2024-07-25 21:22:57 +02:00
Hans Goudey
debf616e02 Cleanup: Formatting 2024-07-25 15:04:35 -04:00
Hans Goudey
0b6a7ee1f3 Cleanup: Sculpt: Use C++ math types/functions for filters 2024-07-25 15:03:03 -04:00
Hans Goudey
e9f6dca59d Fix: Missing normals update in sculpt mesh filter
Mistake in 11a4510e9a.
2024-07-25 15:03:03 -04:00
Lukas Tönne
71af44551e Fix build error when Potrace is disabled
Some utility code for the Grease Pencil image trace operator requires
`WITH_POTRACE` guards.
2024-07-25 20:39:38 +02:00
Philipp Oeser
f5e22cbb11 Fix: KeyingSetsAll RNA path incomplete/wrong
While working on !125365, I was running over a couple of places where
RNA paths were also incomplete in the UI.

This PR covers:
- KeyingSetsAll

Pull Request: https://projects.blender.org/blender/blender/pulls/125412
2024-07-25 20:07:34 +02:00
Hans Goudey
d24957450c Cleanup: Remove unused BMesh fairing function 2024-07-25 13:45:00 -04:00
Hans Goudey
88b6910d06 Cleanup: Sculpt: Remove unnecessary allocation, use references 2024-07-25 13:45:00 -04:00
Miguel Pozo
a83348fbdc GPU: Improve the shader cache behavior
Move the shader cache to `BKE_appdir_folder_caches`, since the
temporary folder is reset on Linux on every system restart.
Manually delete shader cache files on Blender exit if they have not
been used for more than 30 days.

Pull Request: https://projects.blender.org/blender/blender/pulls/125010
2024-07-25 19:22:36 +02:00
Hans Goudey
9e99d0872b Sculpt: Skip scaling deformation translations when unnecessary 2024-07-25 13:20:03 -04:00
Hans Goudey
b17adb58f0 Sculpt: Use new deformation flushing API for face set fairing
Also support clipping/locking.
2024-07-25 13:20:03 -04:00
Miguel Pozo
4919221456 GPU: Batch Compilation: Show compiled GPUMaterials as soon as possible
Request one separate compilation batch for each GPUPass so users can
get a better sense of the compilation progress, and to better distribute
texture loading over time.

Pull Request: https://projects.blender.org/blender/blender/pulls/125012
2024-07-25 19:18:07 +02:00
Harley Acheson
5bf44c6eb4 UI: Text Style for Tooltips
This gives users the ability to control the size of tooltip text
separately from other text styles. This is an accessibility issue
in that users with low vision can choose to make these larger than
the working text.

Pull Request: https://projects.blender.org/blender/blender/pulls/125147
2024-07-25 19:12:41 +02:00
Lukas Tönne
f7672438bf GPv3: Trace image operator
Convert an image to grease pencil strokes by tracing features.

Uses the Potrace library to generate curve on averaged b/w values of the image.
Ported from the GPv2 feature of the same name.

Pull Request: https://projects.blender.org/blender/blender/pulls/125328
2024-07-25 18:44:07 +02:00
Hans Goudey
4742fa7f40 Refactor: Sculpt: Remove BMesh custom data offset from BVH tree
Instead just compute the offsets as necessary. This avoids the need
to keep them in sync as the BMesh changes, though it requires passing
a few more arguments in the dynamic topology remeshing code.
2024-07-25 12:40:14 -04:00
Hans Goudey
6155c72237 Refactor: Sculpt: Remove PBVH BMesh log pointer
This log is owned by SculptSession, it's a bit misleading
to store a pointer to it in the sculpt BVH tree, and having
multiple mutable pointers to objects should generally be
avoided anyway. Now just pass it to the remeshing function
which is the oinly place it was needed anyway.
2024-07-25 12:40:13 -04:00
Harley Acheson
459572b15f UI: Custom Windows Cursors for VSE Handles
VSE has three mouse cursors defined, WM_CURSOR_LEFT_HANDLE,
WM_CURSOR_RIGHT_HANDLE, and WM_CURSOR_BOTH_HANDLES that are currently
always using our default cursor format. This format works on all
platforms but does not support multiple sizes or antialiasing. This
PR makes these use custom cursors (created by Pablo Vazquez) on the
Windows platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/125252
2024-07-25 18:21:16 +02:00
Bill Spitzak
0d70481d15 Refactor: Optimize compositor realization shader
This patch optimizes the compositor realization shader by moving the
centring offset to the host code as opposed to the shader.
2024-07-25 18:58:29 +03:00
Jesse Yurkovich
1c69154aaf Fix #125395: Build: Missing include for s390x arch
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/125397
2024-07-25 17:53:57 +02:00
Hans Goudey
3199915f35 Cleanup: Switch to C++ API for 3D cursor transform
Replace the `BKE_scene_cursor` functions with member functions
of the `View3DCursor` DNA struct. This makes using the cursor's
transform simpler, especially in newer C++ code.

Pull Request: https://projects.blender.org/blender/blender/pulls/124903
2024-07-25 17:53:09 +02:00
Julian Eisel
d2bcca680e Fix asset shelf popup not closing when selecting asset with enter
When typing to search an asset and confirming with enter, the popup
should close.

Mistake in 2781725734.

Steps to reproduce:
- Enter sculpt mode with the default cube active
- Press Shift+Space to open the brush asset selector popup
- Type to search for a brush
- Press enter -- the popup didn't close as it was supposed to
2024-07-25 17:41:49 +02:00
Julian Eisel
3dfd9d84eb Fix memory leak when using grease pencil clone brush
Caused by parallel access to static clipboard storage: Multiple threads
could end up calling `ensure_grease_pencil_clipboard()` in parallel.
Here this resulted in a surprisingly reliable memory leak.

Use a simple mutex lock to prevent unsynchronized access.

Steps to reproduce were:
- Add Grease Pencil object
- Enter grease pencil Sculpt mode
- Select Clone brush asset
- Click in 3D Viewport
- Quit Blender (see console log for leak reports)

Pull Request: https://projects.blender.org/blender/blender/pulls/125428
2024-07-25 17:40:01 +02:00
Falk David
b1f747b19c Curves: Add explanation of magic number in calculate_point_handles
Add an explanation of the math for where the magic `2.5614f` comes from.

Pull Request: https://projects.blender.org/blender/blender/pulls/125302
2024-07-25 17:32:49 +02:00
Sybren A. Stüvel
34067f43b5 Fix compiler errors on non-experimental builds
Fix compiler errors when building without experimental features, by adding
more `#ifdef WITH_ANIM_BAKLAVA` guards around code.
2024-07-25 17:31:04 +02:00
Lukas Tönne
418c63f8db Fix #125229: Fill tool "radius mode" extension was not generating lines
The fill tool's stroke extension feature has a "radius" mode that was
implemented by just drawing filled circles at the end of strokes.
This should work by creating additional lines instead, the circles are
just indicators of the search range.

The radius mode now does a KDTree search for points inside the circles.
It generates extra extension lines and handles these in the usual way,
just like lines generated in "extension" mode.

GPv2 had an undocumented curvature feature that would also add lines to
interior points if their curvature was large enough. This is quite
obscure, not mentioned in the manual, and adds complexity. For now the
feature is not implemented, but some placeholder TODO comments have been
added.

Pull Request: https://projects.blender.org/blender/blender/pulls/125420
2024-07-25 17:29:00 +02:00