Commit Graph

110977 Commits

Author SHA1 Message Date
Campbell Barton
170325744d Merge branch 'blender-v4.2-release' 2024-07-02 11:46:36 +10:00
Campbell Barton
e8a3537ffb Extensions: improve automatic repo names for file:// repos on WIN32
- Skip leading slash from drive letters.
- Use back-slashes.

While these weren't exactly bugs, it seemed like an error when the
path name wasn't what users would expect. Relates to #123994.
2024-07-02 11:45:39 +10:00
Hans Goudey
5bf9fc632b Sculpt: Data oriented refactor for multi-plane scrape brush, part 1
Part of #118145.
This only addresses the deformation part of the brush, the sampling of
the plane normals will be addressed separately. Generally this is a
somewhat strange brush compared to the others, so the order of
utility function calls is slightly different.

Pull Request: https://projects.blender.org/blender/blender/pulls/124018
2024-07-02 03:13:30 +02:00
Sean Kim
9fbfce4a13 Cleanup: Sculpt: Add forward declarations
Pull Request: https://projects.blender.org/blender/blender/pulls/124017
2024-07-02 00:46:39 +02:00
Sean Kim
11db18473d Refactor: Sculpt: Split up smooth::relax_vertex
Pull Request: https://projects.blender.org/blender/blender/pulls/124014
2024-07-01 23:42:55 +02:00
Hans Goudey
4b03274d80 Cleanup: Sculpt: Split function to join multi-plane samples, rename struct 2024-07-01 17:42:10 -04:00
Hans Goudey
3f27917838 Cleanup: Tweak variable naming in multiplane scrape brush 2024-07-01 17:40:03 -04:00
Hans Goudey
29ce7907e2 Cleanup: Sculpt: Simplify access to multiplane scrape planes
Instead of using if statements to choose between the planes,
use array indices.
2024-07-01 17:40:03 -04:00
Hans Goudey
d106592f7b Cleanup: Sculpt: Use C++ math types 2024-07-01 17:40:03 -04:00
Hans Goudey
71038bfbce Cleanup: Sculpt: Move multi-plane scrape code to C++ namespace 2024-07-01 17:40:03 -04:00
Hans Goudey
52bd028bd8 Cleanup: Sculpt: Move utilities to gather grids and BMesh normals
Turns out these functions are useful elsewhere too.
2024-07-01 17:40:03 -04:00
Richard Antalik
639acb2b5d Merge branch 'blender-v4.2-release' 2024-07-01 23:26:21 +02:00
John Kiril Swenson
8d8a84ffb4 VSE: Fix crashes adding freeze-frames to segments
If a freeze-frame retiming key was added to either a transition or
freeze-frame segment when the strip was selected, Blender would crash.
The issue is that `SEQ_retiming_add_key` returns `nullptr` if the start
key of the current segment is one of these types, and never bothers to
cancel the operation if this happens.

Instead, it only attempts to get a key at the current frame with
`SEQ_retiming_key_get_by_timeline_frame`. This is redundant, since there
are already checks to see if that key exists in `SEQ_retiming_add_key`.
Remove this code and move up the other `nullptr` check to fix the bug.

Pull Request: https://projects.blender.org/blender/blender/pulls/123981
2024-07-01 23:25:11 +02:00
John Kiril Swenson
4c8319a227 VSE: Fix retiming unallowed strip type crashes
Currently, many retiming operators are able to operate on all selected
strips. However, if strips that do not support retiming are selected
(e.g. color strips), attempting to perform these operations will crash
Blender. The operators are only polled away if the active strip does
not support retiming -- this is not resilient enough.

This patch fixes the issue by checking each strip to make sure it
supports retiming. Some of the operators do not necessarily crash
without this fix (`retiming_show`, `retiming_key_add`), but still benefit
from exiting early if the current strip does not permit the functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/123975
2024-07-01 23:19:44 +02:00
John Kiril Swenson
607445da5f VSE: Standardize reset retiming operator
Every retiming operator works on selected strips. However, the reset
retiming operator only works on the active strip.

This patch standardizes the behavior so that all selected strips have
their retiming reset. This gives more control to the user to reset
many strips' retiming in bulk.

Pull Request: https://projects.blender.org/blender/blender/pulls/123973
2024-07-01 23:12:52 +02:00
Richard Antalik
952f41a9fd Fix: VSE frame interpolation is broken
Caused by incorrect output of `SEQ_give_frame_index` for effect strips.
Also since output value is float, it has to be truncated to integer,
when image bufferes are rendered for the effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/123914
2024-07-01 23:07:23 +02:00
Sean Kim
6dd9c3254b Refactor: Sculpt: Simplify relax face set strength logic
Pull Request: https://projects.blender.org/blender/blender/pulls/124010
2024-07-01 22:55:43 +02:00
Hans Goudey
7bc188a760 Sculpt: Initial data oriented refactor for grab brush
Part of #118145.
This introduces a few small API functions for retrieving spans of
original positions and normals from the undo system.

Pull Request: https://projects.blender.org/blender/blender/pulls/123447
2024-07-01 22:32:01 +02:00
Sean Kim
3c6f9840db Fix #124002: Multires & BMesh undo doesn't affect mask
Broken in 90c4c48bbf1fe0000d82316ea5196bac394aeefb, missed applying
`undo_node`

Pull Request: https://projects.blender.org/blender/blender/pulls/124006
2024-07-01 21:26:55 +02:00
Hans Goudey
2c0c298675 Fix: Undo doesn't work for sculpt transform tools
An existing issue made visible/worse by c168ef98093a40f5524.
2024-07-01 15:01:05 -04:00
Julian Eisel
4a9e8087a7 UI: Highlight first view item on type to search & activate on enter
In particular, this makes the asset shelf popup search highlight the
first asset when changing the search filter using text input. Pressing
Enter will activate this asset then. The feature is implemented
generally for grid and tree views, but only the asset shelf implements
filtering so far. Plus, it requires the
`UI_BUT2_FORCE_SEMI_MODAL_ACTIVE` behavior on the filter text button,
otherwise it captures all input. Only the popup version of the asset
shelf uses this currently. Moving the mouse makes the highlight jump
back to the brush under the cursor again. This is how search menus
behave too.

Part of the brush assets project, see blender/blender!123853. It's made
so it's possible to quickly spawn the brush asset shelf popup, input
text to search a brush and press Enter to activate it. Based on user
feedback this is an important workflow to support well.

More info about the changes in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/123853
2024-07-01 20:36:51 +02:00
Hans Goudey
0363650990 Fix: Sculpt: Undo restore crash with first operation
Mistake in 057fdf4224e0e07a6020cabd4d2a1ca4f307f0a5
2024-07-01 13:58:58 -04:00
Clément Foucault
beb8ec4fe1 Fix: EEVEE: Wrong subsurface sample distribution
The sample distribution was biased toward 0, which
created sharper details than expected.

However the downside is that the subsurface is now
more jittery because of the low amount of samples.
2024-07-01 19:55:01 +02:00
Jesse Yurkovich
453d55b1c4 Merge branch 'blender-v4.2-release' 2024-07-01 10:12:35 -07:00
Jesse Yurkovich
2eec6a819e Fix: Add missing thin film parameters to MaterialX export
Wire up the new Principled BSDF thin-film inputs when building
MaterialX graphs.

Pull Request: https://projects.blender.org/blender/blender/pulls/123613
2024-07-01 19:08:56 +02:00
Hans Goudey
159502ff8d Cleanup: Sculpt: Move multiplane scrape file to brush folder 2024-07-01 10:41:30 -04:00
Miguel Pozo
ed17e7c0c6 Merge branch 'blender-v4.2-release' 2024-07-01 16:40:29 +02:00
Miguel Pozo
4c314f9a78 GPU: Add --gpu-compilation-subprocesses cmd setting
Allow overriding the `max_parallel_compilations` from the command
line.
Disable compilation subprocesses on RenderDoc sessions.

Pull Request: https://projects.blender.org/blender/blender/pulls/123995
2024-07-01 16:36:01 +02:00
Hans Goudey
bec350ba6e Tests: Simple automated sculpt brush stroke performance test
As an initial step to creating automated regression tests for sculpt brushes,
make our existing performance test script into an automated performance
test. The test uses the brush active in each file and runs the brush stroke
operator on a large generated grid. The time is just for the brush evaluation,
it doesn't include building the PBVH, drawing, etc.

I'm not sure about the consequences of conditionally disabling
`view3d_operator_needs_opengl`, but it was needed to make the test
work in background mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/123148
2024-07-01 16:12:02 +02:00
Hans Goudey
057fdf4224 Fix: Sculpt: Dynamic topology restore from undo doesn't work
We don't push individual nodes for undo, checking for an undo node
wasn't correct.
2024-07-01 10:02:06 -04:00
Lukas Stockner
87159b2871 Cycles: Add Diffuse Roughness option to Principled BSDF
Setting this option to a value above zero replaces the lambertian Diffuse term
with the modified energy-preserving Oren-Nayar BSDF, which matches the OpenPBR
behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/123616
2024-07-01 15:49:09 +02:00
Miguel Pozo
4a15bfe849 Merge branch 'blender-v4.2-release' 2024-07-01 15:48:28 +02:00
Miguel Pozo
2b248d2720 Fix #123207: EEVEE: Disable motion blur on camera change
Pull Request: https://projects.blender.org/blender/blender/pulls/123919
2024-07-01 15:47:10 +02:00
Campbell Barton
ec5c7b9519 Merge branch 'blender-v4.2-release' 2024-07-01 23:34:23 +10:00
Bastien Montagne
9994fbece5 Refactor: VSE: Use new 'PartialWriteContext' class to generate the copy buffer.
This replaces the usage of the old `BKE_blendfile_write_partial` API by
the new `PartialWriteContext` class, in the code generating the 'copy
buffer' blendfile used for copy-pasting video sequences.

This is an interesting example of advanced/complex ID dependencies
handling with the new `PartialWriteContext`, as the 'main. scene storing
VSE data needs to be created (instead of copying the existing scene),
and then the ID dependencies of its sequences need to be filtered based
on their types.

There is no behavioral changes expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118

Pull Request: https://projects.blender.org/blender/blender/pulls/123993
2024-07-01 15:30:17 +02:00
Bastien Montagne
96198e88e1 Refactor: BPY: make 'libraries.write' code use the new PartialWriteContext class.
This makes code behind the `bpy.data.libraries.write()` API use the new
`PartialWriteContext` class, instead of the old
`BKE_blendfile_write_partial` API.

NOTE: This also means that the `blendfile_io` tests using this python
API are now using the new class.

No behavioral changes are expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:28:15 +02:00
Bastien Montagne
3d5d572db6 Core: Rewrite of 'partial blendfile write' feature.
This commit introduces a new `PartialWriteContext` class, which wraps
around a regular Main struct. It is designed to make writing a set of
IDs easy and safe, and to prepare for future 'asset library editing'
low-level code.

The main goal of this refactor is to provide the same functionalities
(or better ones) than existing partial write code, without the very
bad hacks currently done.

It will replace within the coming weeks all current usages of the
`BKE_blendfile_write_partial` API.

Essentially, it allows to:
* Add (aka copy) IDs from the G_MAIN to the partial write context.
  * This process handles dependencies and libraries automatically.
  * A refined handling of dependencies is possible through an optional
    'filtering' callback.
* Keep track of added IDs, to allow de-duplication in case data is added
  more than once.
* Cleanup the context (i.e. remove unused IDs).
* Write the context to disk as a blendfile.

Since the context keeps information to find matches between its content
and IDs from the G_MAIN, its lifespan is expected to be _very_ short.
Otherwise, changes in G_MAIN (relationships between IDs, their session uid,
etc.) cannot be tracked by the context, leading to inconsistencies.
A partial write context should typically be created, filled, written and
deleted within a same function.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:27:54 +02:00
Bastien Montagne
b658087710 Core: Add a new util to clear an IDNameLib_Map.
Also make ID pointer parameter passed to `BKE_main_idmap_remove_id`
const.

There is no behavioral changes expected from that commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:27:49 +02:00
Bastien Montagne
f1c2a93623 Refactor: Core: BKE_main: init/clear code.
This commit allows to initialize and clear a Main struct which
allocation is handled separately.

There is no behavioral change expected from this commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:58 +02:00
Bastien Montagne
8f8c825196 Core: BKE_lib_id: Make local: Add new option to force making indirect data local.
The new `LIB_ID_MAKELOCAL_INDIRECT` option will force indirectly linked
data to also be made local. Note that this was already the case when a
whole library was made local.

Also some cleanup of options for 'make local', and pass
`IDWALK_IGNORE_MISSING_OWNER_ID` to the ID copying code for ID
management, since typically the owner pointer of embedded IDs at that
point is not yet set to its valid value.

There is no behavioral changes expected from this commit (even though
technically it does affect existing ID copying's behavior, there should
be no change in practice).

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:37 +02:00
Bastien Montagne
ce84e5f1a2 Core: Make Library IDs copyable.
There is no behavioral change expected from this commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:31 +02:00
Clément Foucault
d4774a219b Fix: EEVEE: Missing light tiles in light probes
This was caused by the light culling system not
allocating enough tiles to cover the sphere lightprobe
render target.

Taking the max size between the lightprobe target and
the film fixes the issue.

Fixes #117444
2024-07-01 15:04:53 +02:00
Hans Goudey
cd134c30d1 Cleanup: Sculpt: Remove redundant PBVH node variable 2024-07-01 08:21:49 -04:00
Hans Goudey
1e3dc838d9 Cleanup: Sculpt: Use accessors for PBVH node vertex indices
Makes it easier to search for where these are used (and whether it's
the unique or shared vertices being accessed).
2024-07-01 08:21:49 -04:00
Hans Goudey
2e36675dec Fix: Sculpt: Incorrect access of shared PBVH node vertices
Tools should generally only process vertices owned by the current
PBVH node rather than vertices owned by other nodes.
2024-07-01 08:21:49 -04:00
Hans Goudey
7c17339749 Refactor: Sculpt: Specialize expand mask update per PBVH type
Part of #118145.
Duplicate the function three times so it can be implemented specifically
for each data structure. The duplication can be reduced in the future by
using the same methods as the sculpt brush refactor.

This also fixes the incorrect usage of `PBVH_ITER_ALL`, which doesn't
just also iterate over hidden vertices like was probably intended, but also
processes vertices shared between different PBVH nodes multiple times,
one for each node they're contained in.
2024-07-01 08:21:49 -04:00
bf3dd9a743 Anim: add type assertion to graph editor function
In `graph_refresh_fcurve_colors()`, add an assertion that the
`bAnimListElem` data is actually an F-Curve before casting it to one.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123987
2024-07-01 13:44:29 +02:00
dc2fa02f00 Cleanup: Anim, add documentation to Binding::name_without_prefix()
Just some extra documentation that this is also known as the "display name".

No functional changes.
2024-07-01 13:44:28 +02:00
Miguel Pozo
df0ca5382c Merge branch 'blender-v4.2-release' 2024-07-01 13:41:58 +02:00
Miguel Pozo
635db22ca6 Fix: Re-apply versioning made for EEVEE-Next in 4.1
Pull Request: https://projects.blender.org/blender/blender/pulls/123909
2024-07-01 13:37:48 +02:00