Commit Graph

137908 Commits

Author SHA1 Message Date
Hans Goudey
b0d68627a3 Fix: New sculpt brush factors broken with mask attribute
Caused by 6a5c14e58f90552b4c01 which still inverted the mask even though
it was being subtracted from the factor, effectively inverting it anyway.
Instead restore the previous logic which gathered the mask before
dealing with visibility. That's preferred because it can be replaced with
a `gather` when mask storage is inverted to be like selection, and
because the logic is a bit simpler. Also remove the clamping of the mask
since it generally shouldn't break sculpt code and because mask values
are clamped by editing tools already.
2024-06-18 21:06:38 -04:00
Sean Kim
ea90d3f409 Cleanup: Add BLI_array.hh to includes for common brush code
Pull Request: https://projects.blender.org/blender/blender/pulls/123407
2024-06-19 02:35:00 +02:00
Campbell Barton
a9447cf09a Cleanup: spelling in comments 2024-06-19 10:03:37 +10:00
Campbell Barton
f50964bd6c Merge branch 'blender-v4.2-release' 2024-06-19 09:55:47 +10:00
Campbell Barton
30557c148a Merge branch 'blender-v4.2-release' 2024-06-19 09:55:43 +10:00
Harley Acheson
ad625d8dc4 Fix #122423: Clear handlers for non-temporary regions on exit
Resolve regression in [0] which incorrectly replaced
`WM_event_modal_handler_region_replace` with
`WM_event_ui_handler_region_popup_replace`
causing a crash when accessing dangling pointers.

Resolve by restoring the call to clear modal handlers regions.

Ref !122922

[0]: b25eefbf9acb51df61bb264686d9da42d2499e18
2024-06-19 09:49:21 +10:00
Campbell Barton
0cc9762651 Cleanup: spelling in comments 2024-06-19 09:41:11 +10:00
Hans Goudey
6bb978d07d Fix #123382: Subdivision surface crash with no faces
Caused by 31a67805fe73c12419778aa1d67ee3c091402f8c.
2024-06-18 19:10:17 -04:00
Sean Kim
8ac66b1c8e Cleanup: Add comments for StrokeCache variables
Pull Request: https://projects.blender.org/blender/blender/pulls/123402
2024-06-19 01:03:35 +02:00
Lukas Stockner
97b06c429f Cycles: Fix multiscattering Oren-Nayar at glancing angles, update tests 2024-06-18 22:57:52 +02:00
Sean Kim
963eda1db8 Merge branch 'blender-v4.2-release' 2024-06-18 12:50:48 -07:00
Sean Kim
bf2e59e1dd Fix: Relax face set occasionally too strong
In a previous refactor, the iteration variable was shadowed resulting in
the extra strength always being applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/123350
2024-06-18 21:49:35 +02:00
Sean Kim
5a05ceb5db Merge branch 'blender-v4.2-release' 2024-06-18 12:33:26 -07:00
Brecht Van Lommel
a26fd603b0 Merge branch 'blender-v4.2-release' 2024-06-18 21:19:24 +02:00
Hans Goudey
79416a8b96 Refactor: GPU: Simplify access to vertex buffer data
Add a `.data<T>()` method that retrieves a mutable span. This is useful
more and more as we change to filling in vertex buffer data arrays
directly, and compared to raw pointers it's safer too because of asserts
in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/123338
2024-06-18 21:10:45 +02:00
Lukas Stockner
5e40b9bb5c Cycles: Switch to energy-preserving multiscattering Oren-Nayar BSDF
This multiscattering term comes from the OpenPBR specification and nicely
preserves energy while correctly modeling increased saturation at high
roughness.

Preparation for adding a diffuse roughness option to the Principled BSDF.

To me, the difference in output and computation seems small enough to
not need an enum for the old behavior.

Note that this also switches sampling to cosine-weighted, in my tests this
gives lower noise. I also checked doing MIS between cosine and uniform,
using the A term as a weight for how often to use cosine (since that term
is Lambertian diffuse), but always using cosine was better.
A nice consequence of that is that you don't get a huge noise jump when
going from 0.0 to 0.01 roughness.

Pull Request: https://projects.blender.org/blender/blender/pulls/123345
2024-06-18 21:07:21 +02:00
Sean Kim
7a16b9f04f Fix #123335: Expand Face Set behaves incorrectly on new mesh
Without the call to ensure_face_sets_mesh, the initial values of the
cache are 0, not 1. The latter is the correct default value to represent
no face set.

Pull Request: https://projects.blender.org/blender/blender/pulls/123392
2024-06-18 21:03:27 +02:00
Clément Foucault
ff03ab4d08 Fix: EEVEE: Overblur of textures because of TAA
This was a missing block of the TAA implementation.
TAA jitter and reprojection have a tedency to soften
the texture. Add a 1.5 bias to make them a bit sharper.

Note that this is a bit different than the usual TAA
blurring. In final render we don't do reprojection
so it is only because the texture filter (box filter
from the LOD) is applied at the same time than our pixel
filter (blackmann-harris). It is less noticeable than
the normal TAA blur, but still blurs ~2px instead of
1.5px.
2024-06-18 19:31:47 +02:00
Falk David
10b1e45ca8 Fix: Curves: Crash in transform code for non bézier curves
This caused a crash in grease pencil when trying to transform strokes (poly curves).
The code assumed that the left and right handle indices existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/123311
2024-06-18 19:08:11 +02:00
Miguel Pozo
feed10a4c2 Fix: GPU: Workaround for validation errors on replaced passes 2024-06-18 18:36:09 +02:00
Nathan Vegdahl
295df94478 Anim: add "legacy behavior" option to Limit Rotation constraint
This adds a "Legacy Behavior" option to the Limit Rotation constraint that makes
it behave how Limit Rotation constraints did prior to
ed2408400d53e943cb6c97db10f12cf6729ef089. Newly created constraints have this
option disabled, but versioning code enables the option on constraints from
older files to ensure that the behavior of e.g. existing rigs is not altered.

This is one part of a two-part fix for #123105. The other part is in PR
extensions/rigify#4.

Pull Request: https://projects.blender.org/blender/blender/pulls/123361
2024-06-18 18:29:25 +02:00
Brecht Van Lommel
44309ac7e1 Build: Change make deps HARVEST_TARGET to new Git LFS location 2024-06-18 18:20:54 +02:00
Clément Foucault
355c7b788e Fix: EEVEE: Remaining references to EEVEE-Legacy in codebase
Fix #123387
2024-06-18 18:17:34 +02:00
Falk David
6ad04beff8 Cleanup: GPv3: Move create_curves_outline into grease_pencil_geom.cc
Moves the `create_curves_outline` into the editor file `grease_pencil_geom.cc`
in preperation to use it in other places (draw tool).

Pull Request: https://projects.blender.org/blender/blender/pulls/123383
2024-06-18 18:12:45 +02:00
3013630137 Refactor: simplify make_new_animlistelem() by returning early
No functional changes. Just avoiding having the entire function in a
condition.

Pull Request: https://projects.blender.org/blender/blender/pulls/123388
2024-06-18 17:53:44 +02:00
Clément Foucault
e5f514c60c Fix: EEVEE: AO Pass: Regression in quality caused by sample count
Sample count was mismatching the LOD offset leading to
quality regression. Using the same specialization
constant as the fast GI fixes the issue.
2024-06-18 17:53:22 +02:00
Clément Foucault
90c1d5832e Fix: EEVEE: AO: Only clip occluders based on front sample
This is cheaper but avoid loosing the sample influence when
thickness is large.
2024-06-18 17:53:22 +02:00
Clément Foucault
3112799804 Fix: EEVEE: AO: LOD transition too visible at high sample count
This add dithering to the lod steping allowing for a smoother
transition.
2024-06-18 17:53:22 +02:00
Clément Foucault
d41cd2095a EEVEE: Make render tests use volume indirect lighting 2024-06-18 17:53:22 +02:00
Pablo Vazquez
e55af25f38 VSE: Enable "Preview During Transform" by default
Turn on `Preview During Transform` by default on new scenes.

Old files are not affected, they will keep whatever setting they had.

Pull Request: https://projects.blender.org/blender/blender/pulls/123374
2024-06-18 17:38:07 +02:00
Alaska
56bb8b2b3c Fix #123324: Improve Cycles camera bounding box size calculation
Cycles runs a check to see if the camera is possibly inside a
volumetric object by seeing if the bounding box of the camera
and volumetric object intersect.

If the calculation is wrong (Cycles says the camera is outside the
volume when it's inside it), then the volume will not render properly.

This commit resolves most of these issues by making the camera
bounding box larger than before, taking into consideration
features like:

1. The impact DOF could have on the camera ray start position and how
that should impact the bounding box size.
2. Taking into consideration near clipping, which was missed from the
orthographic camera due to a oversight in a previous commit
(08cc73a9bb).

Pull Request: https://projects.blender.org/blender/blender/pulls/123341
2024-06-18 17:35:16 +02:00
Jeroen Bakker
0643f495cd Vulkan: Fix incorrect write access mask in pipeline barriers
By adding the previous mask, masks could be used in pipeline
stages that don't support the mask. Fixed by limiting the
mask to the current node.

Pull Request: https://projects.blender.org/blender/blender/pulls/123381
2024-06-18 17:17:20 +02:00
Falk David
f897d37f38 Fix: GPv3: Thickness adjustment conversion doesn't use object scale
To get the same visual result compared to GPv2, the thickness adjustment value
needed to be divided by the object scale.
2024-06-18 17:06:23 +02:00
Julian Eisel
85b06f49b5 Cleanup: Correct function name in comment/asserts 2024-06-18 16:59:20 +02:00
Julian Eisel
e4a77397d5 UI: Don't show tooltips when spawning popups until mouse is moved
Popups are often spawned with a button under the mouse cursor. For some
kinds of popups this would immediately invoke the tooltip timer, so
after a short moment tooltips would show. This can be annoying, since
the tooltip can overlap elements and the user's input was intended to
spawn a popup, not also spawn a tooltip. Even worse, the asset shelf
popup uses quick tooltips, so spawning that popup would almost instantly
also spawn the quick tooltip (see PR for demo video).

Instead, disable tooltips until the user moves the mouse. Menus
triggered from shortcuts (e.g. the Shift+A "Add" menu) would already
behave this way.

Pull Request: https://projects.blender.org/blender/blender/pulls/123363
2024-06-18 16:54:28 +02:00
Sean Kim
09926bbae0 Sculpt: Initial data oriented refactor for smooth mask brush
Part of #118145.

Currently a fair amount slower than the existing version, 0.61ms
compared to 0.12ms per brush step invocation.

Pull Request: https://projects.blender.org/blender/blender/pulls/123215
2024-06-18 16:49:24 +02:00
Philipp Oeser
7964b25a8e Merge branch 'blender-v4.2-release' 2024-06-18 16:44:57 +02:00
Philipp Oeser
751745b2de Fix #123220: Export GP SVG/PDF crash when active object is not GP
`GpencilIOParams.ob` is set to `CTX_data_active_object` at the beginning
of the export [which is not ensured to be a valid `OB_GPENCIL_LEGACY`
object, non-valid objects are filtered out later in
`create_object_list`]. From this (potential non-greasepencil) object's
data, a "global `bGPdata` is stored in `GpencilIOParams`.

From here, it can only go downwards as `stroke_point_radius_get`,
`export_stroke_to_polyline`, `BKE_gpencil_stroke_perimeter_from_view`
all use this "global" `bGPdata`.

Two possible solutions might exist:
- [1] just cancel the operator if the active object is not a
`OB_GPENCIL_LEGACY` object
- [2] make sure we use corresponding `bGPdata` when iterating over
valid objects to export

This PR chooses [2] since it also seems wrong to always use the
`bGPdata` from the active object for certain calculations when iterating
many objects. For example, the export ignores different values for
`Thickness Scale` on different objects and always takes the value from
the active object, which does not seem to be by design.

NOTE: this changes behavior (see above) but for the better
Pull Request: https://projects.blender.org/blender/blender/pulls/123224
2024-06-18 16:44:08 +02:00
Miguel Pozo
44c1fa2f06 Merge branch 'blender-v4.2-release' 2024-06-18 16:15:59 +02:00
Miguel Pozo
9d5f46b1b8 Cleanup: EEVEE: Remove unused variable 2024-06-18 16:15:26 +02:00
Pablo Vazquez
6684504d4f UI: Rename "Strip Colors" panel in theme editor
Rename to "Strip Color Tags" to match how these are called throughout
menus and overlay popover.
2024-06-18 16:13:28 +02:00
Christoph Lendenfeld
99796991d8 Fix #123245: Inserting keys was lacking depsgraph update
When inserting new keys, the depsgraph needs to be updated.
Since that was missing with the new keying code, the NLA wasn't
working properly when inserting the first key.

Pull Request: https://projects.blender.org/blender/blender/pulls/123360
2024-06-18 16:03:38 +02:00
Christoph Lendenfeld
1070ae46fa Fix #122490: Snapping with free handles doesn't move the handles
When snapping keyframes in the Graph Editor, handles
that were set to free didn't move.

The issue was that the snapping code didn't set the handle position.
Instead it relied on the handle recalculation (`calchandleNurb_intern`) to do the job.
That code doesn't affect free handles though.

The fix is to also offset the handles in the snapping code. The handle recalculation
will still run for all the other handle types so that behavior isn't expected to change.

This does NOT change the behavior of bezier snapping in the 3D viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/123173
2024-06-18 16:00:37 +02:00
Clément Foucault
8cd282e48c Merge branch 'blender-v4.2-release' 2024-06-18 15:35:17 +02:00
Clément Foucault
979e142965 Fix: EEVEE: Object holdout not working
This implement the holdout flag by switching to
the holdout case in the shader. This has a few benefits:
- Doesn't recompile the shaders.
- Makes the object infos mandatory (already the case in
  practice)
- Handle transparent materials properly, keeping the
  transparency working.

Fix #123284

Pull Request: https://projects.blender.org/blender/blender/pulls/123315
2024-06-18 15:35:04 +02:00
Patrick Mours
56c1163c21 Fix: Cycles OptiX wrong stack size for OSL pipeline
The callables generated by OSL reference other external functions
(defined in the OSL services module), in which case OptiX cannot
calculate the right stack size just based on the callable alone, it needs to
know all functions linked together in the pipeline to get to an accurate
result. `optixProgramGroupGetStackSize` has an optional pipeline
argument for this purpose, so make use of that to ensure the correct
stack size is calculated.

Ref #122779

Pull Request: https://projects.blender.org/blender/blender/pulls/123368
2024-06-18 15:27:14 +02:00
Jeroen Bakker
71c716d8c0 Vulkan: Fix incorrect texture update
Texture update ignored layered based offsets and extents. This was
an oversight due to misintepreting the API. This fixes uploading the
utility texture of EEVEE and enables correct material shading.

Pull Request: https://projects.blender.org/blender/blender/pulls/123371
2024-06-18 14:58:41 +02:00
Clément Foucault
0dc5abc9e5 Fix: EEVEE: Infinite loop in shadow update
This happened in the following render test:
`render/light/all_light_types_in_volume.blend`

Unfortunately it seems non-deterministic.
To fix this, we change the heuristic to jump
out of the shadow update loop. Also introduce
a upper bound to the number of iteration.

On top of this, add a flush for every loop
to avoid huge command buffer submission.

Thanks @pragma37 for the fix.
2024-06-18 14:55:41 +02:00
eb731c036b Refactor: Anim filtering, avoid passing bDopesheet *ads parameter
In the animation filtering code, avoid passing `bDopesheet *ads` as a
separate parameter. Instead, pass `bAnimContext *ac`. This already
contains the same pointer. Some carefully placed asserts help to
verify that these pointers were indeed the same.

Not only do I think this approach is cleaner, it is a necessary step
for upcoming PRs #123187 and #122672. Those will need a `Main *bmain`
pointer, which is already available in the `bAnimContext` struct.

Mostly this is just dumb search & replace.

- `ads` → `ac->ads`
- `bDopeSheet *ads` parameter → remove, and add `bAnimContext *ac`
  parameter if necessary. That parameter should be the first parameter
  of the function.
- Unused `ads` parameter translates to unused `ac` parameter. Chances
  are, that parameter will be necessary for the `Main *bmain` anyway.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123305
2024-06-18 14:07:12 +02:00
Christoph Lendenfeld
1ab66a6b4f Fix #116138: Hidden bones cannot be active
This PR modifies the check for visibility when selected in the outliner.
With the change the visibility check only affects the selection state, not the active state.
The check has also been swapped with a function call to `ANIM_bone_is_visible_editbone`,
so now correctly works with collection visibility.

This PR also fixes the same issue for `Bone` and `bPoseChannel`

Co-authored-by: Cedric-Hutchings

Pull Request: https://projects.blender.org/blender/blender/pulls/123237
2024-06-18 13:54:36 +02:00