Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
385cc4fb3b Cleanup: Sculpt: Use references for SculptSession variables 2024-06-20 13:39:33 -04:00
Hans Goudey
2079507ca5 Refactor: Sculpt: Separate geometry and per-node undo step code paths
Sometimes undo data is stored per PBVH node, and sometimes the entire
geometry is stored. Currently these go through the same `undo::push_node`
function, which is confusing and limits improvements we can make to the
pushing of per-node undo data.
2024-06-20 13:39:33 -04:00
Hans Goudey
e472055db1 Cleanup: Sculpt: Use std::mutex instead of global LOCK_CUSTOM1 2024-06-20 13:39:33 -04:00
Hans Goudey
63735bb212 Sculpt: Move pivot transform out of per-node undo data
Similar to 21f204b06e.
2024-06-20 13:39:33 -04:00
Hans Goudey
5c39182be8 Sculpt: Move shape key name out of per-node undo data
Similar to 21f204b06e.
2024-06-20 13:39:33 -04:00
Harley Acheson
402610b766 Merge branch 'blender-v4.2-release' 2024-06-20 10:31:13 -07:00
Harley Acheson
6ef2e6f606 Fix #123471: Ensure Trailing Slash for Default Folder Path
In file_browse_invoke, if the path is blank we attempt to use
BKE_appdir_folder_default_or_root to get the user's normal document
root.  However we are not ensuring that the directory path has a
trailing slash, which can result in it being misinterpreted as a file
path instead, separating out the last path part. This PR only adds a
call to BLI_path_slash_ensure.

Pull Request: https://projects.blender.org/blender/blender/pulls/123504
2024-06-20 19:30:18 +02:00
Clément Foucault
6161cc183e Fix: EEVEE: Fast GI: Firefly in noisy regions
This was caused by some pixels having no good neighbors
to get the irradiance from. The weighted sum would
have huge precision issues and the values would blow-out.

Adding an epsilon weight tailored to the report file
to fix this issue.

Fix #123488
2024-06-20 18:50:36 +02:00
Pablo Vazquez
7bbb914949 Merge branch 'blender-v4.2-release' 2024-06-20 18:13:36 +02:00
Pablo Vazquez
e2acb73a03 Fix: VSE padding of missing media/data-block icon
The icon for missing media/data-block would be too close to the edges.

Decrease the size so it matches the size of the label and aligns with
the text baseline.
2024-06-20 18:12:12 +02:00
Miguel Pozo
4f8650d5c2 Fix #122714: Workbench: Missing textures not shown in Texture Paint mode with magenta
Missing feature from the Workbench Next port.

Pull Request: https://projects.blender.org/blender/blender/pulls/123034
2024-06-20 18:08:13 +02:00
Miguel Pozo
d8e710885c Fix #122714: Workbench: Missing textures not shown in Texture Paint mode with magenta
Missing feature from the Workbench Next port.

Pull Request: https://projects.blender.org/blender/blender/pulls/123034
2024-06-20 18:06:26 +02:00
Miguel Pozo
c90b78bb6e Merge branch 'blender-v4.2-release' 2024-06-20 18:03:56 +02:00
Miguel Pozo
33005ad716 GPU: Non-blocking specialization constants compilation
Update the batch specializations compilation to allow using it in an
async way.

The implementation has 2 main limitations:
- Only one batch at a time can be processed, extra batches will be
  added to a queue.
- Binding a specialization variant that is still being compiled will fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/123015
2024-06-20 18:02:44 +02:00
Pablo Vazquez
fc999a4a73 Merge branch 'blender-v4.2-release' 2024-06-20 17:43:13 +02:00
Pablo Vazquez
8cb0b347ae Fix: VSE readability for missing muted/media/datablock labels
With the recent change for labels to be black when not active/selected,
the hardcoded colors of missing media/data-blocks make it hard to read.

- Use a lighter color just like muted strips.
- Makes active/selected muted strips draw labels in full opacity, for consistency.
- Make muted strips a little less gray (50% instead of 80%)

Pull Request: https://projects.blender.org/blender/blender/pulls/123494
2024-06-20 17:36:58 +02:00
Sergey Sharybin
09394c5445 Merge branch 'blender-v4.2-release' 2024-06-20 17:07:28 +02:00
Sergey Sharybin
bab46b4f02 Fix: Crash opening new file after having one open with Subsirf
There is some special code in the Object's freeing which did
special checks for SubdivCCG based on the evaluated mesh state.
If the depsgraph is destroyed prior to the evaluated object it
makes object to access freed components of ID node.

The fix makes it so the evaluated ID is freed prior to freeing
components.
2024-06-20 17:02:55 +02:00
Falk David
6d301c12af Fix #123489: GPv3: Outline modifier outputs wrong radii
This was introduced by 6ad04beff8.
It replaced a multiplication by a division by mistake.
2024-06-20 16:22:54 +02:00
Laurynas Duburas
1c56e8bc68 Curves: Add Bezier handle support to extrude tool
Moving after extrude looks weird when selecting a Bezier point with both
handles and extruding it. This happens because old handles are selected
as well as new ones. Patch takes `".selection_handle_left"` and
`".selection_handle_right"` attributes  into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/121340
2024-06-20 16:07:07 +02:00
Falk David
6226a66054 Fix: GPv3: Crash on conversion for files with editcurves
Blender would crash if it tried to convert a grease pencil
data-block with strokes that used the editcurve.

This was because of a wrong assertion that assumed
to work with a poly curve.

The fix moves the assertion to the correct place where
we handle the poly curves.
2024-06-20 16:01:25 +02:00
Philipp Oeser
89d302f063 Merge branch 'blender-v4.2-release' 2024-06-20 15:42:12 +02:00
Philipp Oeser
5a8003091c Fix #123181: Sculpt Transform tools dont keep verts on the symmetry axis
From the user perspective, the transform tools in editmode and
sculptmode look like the same tools, the equal behavior could be
expected.

So now set vertices on the mirror axis (check with the same epsilon as
editmode transform) while transforming, replicating what
`mesh_transdata_mirror_apply` does.

Pull Request: https://projects.blender.org/blender/blender/pulls/123428
2024-06-20 15:41:23 +02:00
Jacques Lucke
a1a13bad06 Merge branch 'blender-v4.2-release' 2024-06-20 15:30:41 +02:00
Jacques Lucke
ada367a0e9 Fix #119589: use-after-free when accessing not-fully-evaluated object geometry
While the evaluated result is not well defined, we expect Blender to not crash
when there are dependency cycles.

The evaluation of one object often takes the evaluated geometry of another
object into account. This works fine if the other object is already fully
evaluated. However, if there is a dependency cycle, the other object may not be
evaluated already. Currently, we have no way to check for this and were mostly
just relying on luck that the other objects geometry is in some valid state
(even if it's not the fully evaluated geometry).

This patch adds the ability to explicitly check if an objects geometry is fully
evaluated already, so that it can be accessed by other objects. If there are not
dependency cycles, this should always be true. If not, it may be false
sometimes, and in this case the other objects geometry should be ignored. The
same also applies to the object transforms and the geometry of a collection.

For that, new functions are added in `DEG_depsgraph_query.hh`. Those should be
used whenever accessing another objects or collections object during depsgraph
evaluation. More similar functions may be added in the future.
```
bool DEG_object_geometry_is_evaluated(const Object &object);
bool DEG_object_transform_is_evaluated(const Object &object);
bool DEG_collection_geometry_is_evaluated(const Collection &collection);
```

To determine if the these components are fully evaluated, a reference to the
corresponding depsgraph is needed. A possible solution to that is to pass the
depsgraph through the call stack to these functions. While possible, there are a
couple of annoyances. For one, the parameter would need to be added in many new
places. I don't have an exact number, but it's like 50 or so. Another
complication is that under some circumstances, multiple depsgraphs may have to
be passed around, for example when evaluating node tools (also see
`GeoNodesOperatorDepsgraphs`).

To simplify the patch and other code in the future, a different route is taken
where the depsgraph pointer is added to `ID_Runtime`, making it readily
accessible similar to the `ID.orig_id`. The depsgraph pointer is set in the same
place where the `orig_id` is set.

As a nice side benefit, this also improves the situation in simple cases like
having two cubes with a boolean modifier and they union each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/123444
2024-06-20 15:24:38 +02:00
Pablo Vazquez
1e0eb925c4 Merge branch 'blender-v4.2-release'
# Conflicts:
#	source/blender/blenkernel/BKE_blender_version.h
#	source/blender/blenloader/intern/versioning_400.cc
2024-06-20 15:18:37 +02:00
Pablo Vazquez
c2437d11de Fix: VSE strip text label readability
During the strips redesign it was tested to go with drop shadows but
in practice and based on user feedback it looks better without.

- Remove drop shadow.
- Use white text for active/selected strips, black for unselected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123487
2024-06-20 15:10:33 +02:00
Clément Foucault
d3e4eb49a0 Fix: EEVEE: Broken Lightprobe sphere display
The vertex shader was not writting to the position
attribute output.
2024-06-20 15:06:28 +02:00
Jeroen Bakker
55d75a1de3 EEVEE: Light probe resolution
EEVEE stores light probes using octahedral mapping. Compared to the previous
cubemap storage octahedral has less pixels. The 64x64 is becoming useless
and can be removed. This PR also enables generating light probe maps upto 4k.

Some issues were found: the offset of the sphere inside the atlas
was always set to mipmap level 0 offset. This was hidden because of the texture
wrapping. Also the offset was substracted from the local texture
coordinate when calculating the direction of the pixel. Might be that due
to the incorrect offset (mipmap level 0), the latter issue was never detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123074
2024-06-20 15:06:03 +02:00
Jeroen Bakker
af72c1f21d EEVEE: Light probe resolution
EEVEE stores light probes using octahedral mapping. Compared to the previous
cubemap storage octahedral has less pixels. The 64x64 is becoming useless
and can be removed. This PR also enables generating light probe maps upto 4k.

Some issues were found: the offset of the sphere inside the atlas
was always set to mipmap level 0 offset. This was hidden because of the texture
wrapping. Also the offset was substracted from the local texture
coordinate when calculating the direction of the pixel. Might be that due
to the incorrect offset (mipmap level 0), the latter issue was never detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123074
2024-06-20 15:02:11 +02:00
Jeroen Bakker
4c8de4aedd Vulkan: Fix multi viewport framebuffers
Due to incorrect logic any multi viewport setup could be cleaned
when dynamic rendering begins. This patch moves the clearing
of the viewport/scissor setup when binding.

This issue fixes shadow rendering in EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/123484
2024-06-20 14:46:48 +02:00
Brecht Van Lommel
a18ab98785 Fix #122131: Image undo issues with editable linked images
Store library filepath so we can find the right datablock.

Tested to work with the brush assets project branch, as this
currently does not affect anything in main.

Pull Request: https://projects.blender.org/blender/blender/pulls/123449
2024-06-20 14:13:50 +02:00
Jeroen Bakker
faf0171c36 Vulkan: Make stencil export optional
`VK_EXT_shader_stencil_export` isn't supported by NVIDIA devices.
This extension was recently added to support EEVEE PBR layer selection.

This PR makes this extension optional and selects the work around
when not supported by the physical device.

Fixes #114385

Pull Request: https://projects.blender.org/blender/blender/pulls/123470
2024-06-20 14:12:07 +02:00
Jacques Lucke
a9a047c0e3 Core: use implicit sharing for PackedFile data
Found this bottleneck when checking #122281. With this patch, `ED_undo_pop` in
the provided file speeds up from `132 ms` to `18 ms`.

Pull Request: https://projects.blender.org/blender/blender/pulls/123243
2024-06-20 14:09:29 +02:00
Nathan Vegdahl
3ab3ac1b0a Anim: make "XYZ to RGB" user preference work for layered actions
The approach taken here is to pass an optional `PropertySubType` parameter down
the call chain from `insert_key_layered_action()` and terminating at
`create_fcurve_for_channel()`, which uses it to determine the color mode for
new fcurves.

The parameter is optional to allow other callers (e.g. Python RNA functions)
to skip passing it, in which case any new fcurves will get the default rainbow
coloration.

Pull Request: https://projects.blender.org/blender/blender/pulls/123022
2024-06-20 14:05:09 +02:00
Campbell Barton
af0f171176 Merge branch 'blender-v4.2-release' 2024-06-20 22:03:32 +10:00
Jacques Lucke
d3157699e2 BLO: remove unused packedmap from read file data
I found that `packedmap` is effectively unused when I worked on #123243.
The only function that wrote to it was `blo_make_packed_pointer_map`
and that is never called. Packed data already used the normal `datamap` as fallback.

Pull Request: https://projects.blender.org/blender/blender/pulls/123244
2024-06-20 13:51:48 +02:00
Clément Foucault
ab0e6386fc Fix: EEVEE: Imprecision in HiZ gather coordinates
The offset was only 0.5 which centered the gather
sample exactly on the first pixel of the quad.
With floating point arithmetic differences on Nvidia
this lead to the wrong set of texture pixel being
fetched by gather.

Using the coordinate at the center of the quad fixes
the issue.

Fix #123262
2024-06-20 13:06:52 +02:00
Aras Pranckevicius
c059eb73d9 Merge branch 'blender-v4.2-release' 2024-06-20 14:06:20 +03:00
Aras Pranckevicius
b76a95b8b4 Fix: VSE timeline strip outline readability
With selected strips, it is not clear where one of them begins and another
ends since their outlines are right next to each other.

This changes strip look so that:
- All strips have consistent dark 1pt outline at the outer edge.
- Selected strips have 2pt highlight inside said outer edge.
- Selected strips also have a 1pt wide 33% opacity darker line inside the
  selection highlight (and inside possible handles). To improve readability
  in case strip content happens to be similar to selection/active color.

Images in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/123431
2024-06-20 13:01:26 +02:00
Falk David
6daf139694 GPv3: Draw Tool: Outline setting
This ports the outline setting from GPv2 to GPv3.

Internally, the same code as for the outline modifier is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/123440
2024-06-20 12:07:24 +02:00
Jeroen Bakker
4353b7ffba Vulkan: Remove unused code
Vulkan backend has recently switched to a render graph approach. Many
code was left so we could develop the render graph beside the previous
implementation. Last week we removed the switch. This PR will remove
most of the unused code. There might be some left and will be removed
when detected.

Pull Request: https://projects.blender.org/blender/blender/pulls/123422
2024-06-20 11:34:19 +02:00
Lukas Tönne
ccb3989865 GPv3: Implement the alpha threshold setting for the Fill tool
The fill tool can take opacity into account ("Advanced" brush settings).
In that case any point with a total opacity lower than the threshold is
rendered as a transparent boundary.

This was still a hardcoded setting in the fill tool, now uses brush
settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/123469
2024-06-20 11:14:33 +02:00
Pratik Borhade
88553d07b1 Cleanup: Remove semicolon
It was added in e42281084b
Resolves #123466
2024-06-20 14:36:10 +05:30
Sybren A. Stüvel
5e6e8bcfb2 Refactor: Anim, remove unnecessary nullptr checks
Remove some `nullptr` checks from an operator exec function, which are
unnecessary because the corresponding poll function already checks for
them.

No functional changes.
2024-06-20 10:34:22 +02:00
Sybren A. Stüvel
b07f0e8a65 Anim: prevent pushing down layered Actions onto the NLA
Prevent creating NLA strips from layered Actions via the 'Push Down'
operator.

Maybe in the future the NLA will support layered Actions (as a transitional
phase, before the NLA is replaced with layered Actions itself). For now,
it's better to create stable boundaries to prevent their use in the NLA.
When NLA support is being worked on, those boundaries can be removed again.

Pull Request: https://projects.blender.org/blender/blender/pulls/123467
2024-06-20 10:25:52 +02:00
Sybren A. Stüvel
4c0a77ee8f Anim: avoid logged warnings when visiting layered Action in NLA evaluation
Avoid logging actions about `action->idroot` not matching, when evaluating
the NLA and visiting a layered Action. Layered Actions are not limited to
a single data-block type, and so the code should ignore `action->idroot`.
2024-06-20 10:05:34 +02:00
Sybren A. Stüvel
aa0e5368e7 Anim: add layered Action support to BKE_action_frame_range_calc()
Add layered Action support to `BKE_action_frame_range_calc()`, by
looping over all F-Curves of all Bindings in the Action.

Introduce `animrig::fcurves_all(action)`, which returns a vector of all
F-Curves in the Action, both for legacy and layered Actions.

No functional changes for legacy Actions.
2024-06-20 10:05:34 +02:00
Sybren A. Stüvel
54ed2a927e Refactor: Anim, simplify BKE_action_frame_range_calc()
Simplify `BKE_action_frame_range_calc()` by returning early and replacing
`short` with `bool`.

No functional changes.
2024-06-20 10:05:34 +02:00
Sybren A. Stüvel
b9283baf4e Refactor: Anim, simplify action_pushdown_poll()
Simplify `action_pushdown_poll()` by flipping conditions & returning early.

No functional changes.
2024-06-20 10:05:34 +02:00