Commit Graph

120055 Commits

Author SHA1 Message Date
Sergey Sharybin
a2f825fde5 Cleanup: Strict compiler warning in release mode
Fixes warning: unused variable 'no_resync_recurse_max' [-Wunused-const-variable]
2024-07-17 14:31:48 +02:00
Richard Antalik
6a39d79967 Fix #124767: VSE cache not updated for moved strips
The cache invalidation worked on basis of timeline frame instead of
frame index, which caused, that these images were outside of range, that
was considered to be changed, after strip was moved.

In this case the issue happened only with effect strips. This was not
an issue before, mainly because raw images for these strips were not
stored. For other strip types, raw image does not usually change.

This seems to be "caused" by f4f708a54f .

Pull Request: https://projects.blender.org/blender/blender/pulls/124870
2024-07-17 14:23:57 +02:00
Clément Foucault
dd3a48642e Fix: UI: Assert failure with displaying node editor
Caused by mixing UINT and INT in interface and VBO
descriptor.

Fix #124716

Pull Request: https://projects.blender.org/blender/blender/pulls/124880
2024-07-17 14:20:28 +02:00
Weizhen Huang
c7c55894e4 Fix: EEVEE principled coat has tint when the weight is zero
caused by 26eb5d9899

Pull Request: https://projects.blender.org/blender/blender/pulls/124856
2024-07-17 13:54:26 +02:00
Jeroen Bakker
823de4b3b8 Vulkan: Add support for colored particle hair
When using particle hair the optional generated color buffer was bound
as a texture (texel buffer), however in Vulkan texel buffers aren't
textures but buffers.

This change will create a texture, that will pass the needed calls to
the source vertex buffer. Only particle hair does uses
`GPU_texture_create_from_vertbuf`. I would expect that we will phase
this out eventually when particle hair is removed.

This fixes crashes with scenes using particle hair where materials use color
or uv attributes.
![image](/attachments/d5511eee-4db0-4241-bf00-472834c4ca7b)

Pull Request: https://projects.blender.org/blender/blender/pulls/124854
2024-07-17 13:32:06 +02:00
Sebastian Parborg
aac0189e2c Fix #124868: Frame Selected didn't move of the X-axis sometimes
It would not execute the "Frame Selected" action if the viewport already
fully zoomed out on the y-axis. However we still need to center the
viewport around the selected strips x position.
2024-07-17 13:08:34 +02:00
Bastien Montagne
f87b5fdc67 Add FIXME comment about suspicious difference in readfile vs. link code. 2024-07-17 12:57:47 +02:00
Bastien Montagne
ac284c1694 Fix #124777: Segfault when opening .blend file with invalid shapekey.
Prevent doing layer collection resync during most of
`blo_read_file_internal` process. This is dangerous (since during
blendfile read there is no way to ensure that Main is in a fully valid
sate), and a useless costly process.
2024-07-17 12:57:47 +02:00
Bastien Montagne
8df93cd751 BKE: id_delete: Do not forbid layer collection resync in non-Main case.
There is no reason to deal with layer collections resync in non-main
case, deletion code should never trigger it anyway.

This will avoid quite a lot of the non-main-thread calls to
`BKE_layer_collection_resync_forbid` (detected and 'fixed' in previous
commit).
2024-07-17 12:57:47 +02:00
Bastien Montagne
9b8001f370 BKE Layers: make 'no_resync' flag re-entrant and thread-safe.
This commit allows re-entrant calls to
`BKE_layer_collection_resync_forbid` and
`BKE_layer_collection_resync_allow`, such that higher-level code can
block layer collections updates while calling lower-level code that does
the same thing.

E.g. `BKE_id_delete` blocks and then re-allows such updates. However,
such code can also be called from other pieces of code that also need
to prevent these updates in their own, broader scope.

In addition, realized that this call had concurrency issues since BKE
code using it is called from non-main thread too (e.g. from depsgraph
evaluation).

So made the counter atomic to ensure all calls to
`BKE_layer_collection_resync_forbid` is matched by a call to
`BKE_layer_collection_resync_allow`. Also added a cap to max amount of
're-entrant' calls (has to be quite high, due to potential concurrent
calls too).

This is required to fix #124777.
2024-07-17 12:57:47 +02:00
Bastien Montagne
6cf4294c68 Comment about known issue with some old blenfiles triggering a write assert.
File from #124777 (from 2.79.1) cause a temp bScreen to not be properly
tagged as such, which prevents its deletion when related window is
closed, and leaves a zero-user bScreen in Main.

While this should not happen, this does not seem trivial to track down,
and not an important enough issue to spend more time on it.

Also reported as #124857.
2024-07-17 12:57:43 +02:00
Alaska
7438bf8e0f Fix #124817: Incorrect Cycles "Cast Shadow" versioning
This commit fixes a issue where the Cycles "cast shadow" setting
versioning from Blender 4.1 to 4.2 wasn't working properly due to the
use of the wrong parameter name when grabbing the Blender 4.1 setting.

Pull Request: https://projects.blender.org/blender/blender/pulls/124834
2024-07-17 11:57:30 +02:00
Omar Emara
3ca6aa19c9 Fix #124788: Missing passes after drag and drop image
Multi-layer image passes are missing after dragging and dropping an EXR
into the compositor editor. To fix this, we tag the new nodes as needing
an update due to changed ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/124855
2024-07-17 11:34:19 +02:00
Richard Antalik
555352faf9 Fix: Retiming keys are not visble
Caused by checking if retiming mode is active to prevent executing
unnecessary code paths.

Check if keys exist instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/124840
2024-07-17 10:58:58 +02:00
Jacques Lucke
136148a668 Cleanup: remove used FileData flag
Pull Request: https://projects.blender.org/blender/blender/pulls/124784
2024-07-17 10:39:19 +02:00
Jacques Lucke
87bee7a431 Cleanup: use Map in read_library_linked_ids
This simplifies the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/124789
2024-07-17 10:38:29 +02:00
Omar Emara
f0ec207e9c Fix #124298: Cryptomatte node makes UI very slow
The Cryptomatte node makes the UI very slow in Image mode. That's
because the node updates its available Cryptomatte layers on every
redraw, which is a blocking operation that is not very fast.

To fix this, we only update the layers when engine layers change for
the Scene mode, and when image settings change for Image mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/124738
2024-07-17 09:40:28 +02:00
Omar Emara
0e7f80b262 Refactor: Remove redundant Cryptomatte frame update
Cryptomatte layer initialization required the active scene to update the
image user frame, but the image user is already updated through other
mechanisms and is thus redundant to do at draw time, so we remove the
frame update call as well as the scene argument from the call chain. The
frame number of the image user is ignored at compositing time in any
case since it is set to the compositing scene frame.

This is needed for #124738.
2024-07-17 10:12:48 +03:00
Campbell Barton
f8f809da19 Cleanup: removed unused variables 2024-07-17 16:17:07 +10:00
Pratik Borhade
16f21e78e5 Fix #124770: File Browser: Crash when going in and out of folders
Caused by 525293a95d
Crash due to attempt of double freeing. Fix is to make first and
last nullptr of list after freeing the memory. This avoids execution of
`folderlist_free` (`if(folderlist_clear_next())` is false)

Pull Request: https://projects.blender.org/blender/blender/pulls/124781
2024-07-17 05:59:51 +02:00
Hans Goudey
58518347f2 Sculpt: Data oriented refactor for "Set Pivot Position" operator
Part of #118145.

Change the "Pivot to Unmasked" and "Pivot to Mask Border" operations
to avoid the vertex iteration macro. The former also uses a proper
weighted average now, so mostly-masked vertices have less influence.
The whole operation is multithreaded now so I expect it's a bit faster,
but I didn't explicitly test that.

Pull Request: https://projects.blender.org/blender/blender/pulls/124743
2024-07-17 04:40:08 +02:00
Hans Goudey
b8eb872583 Sculpt: Simplify gathering of position data
Reduce the number of lines necessary to get positions data local
to a PBVH node.
2024-07-16 17:27:22 -04:00
Hans Goudey
c190d0251b Cleanup: Sculpt: Use utility functions to gather and scatter masks 2024-07-16 17:27:22 -04:00
Sean Kim
76a1e19e79 Cleanup: Extract flood_fill to sculpt_flood_fill.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/124819
2024-07-16 23:14:48 +02:00
Sean Kim
b336448de1 Refactor: Expose specialized nearest_vert_calc methods
Pull Request: https://projects.blender.org/blender/blender/pulls/124820
2024-07-16 23:13:24 +02:00
Sean Kim
2e487ec92e Fix #124484: Debug assert on undoing out of Sculpt Mode
While this is a rather fragile fix, the alternative also seems fragile.
We can instead check the operator name inside `push_begin_ex` to see if
the operator is transitioning into Sculpt Mode and initialize the
StepData.type to a custom "Mode Change" type instead of using "None"

Pull Request: https://projects.blender.org/blender/blender/pulls/124640
2024-07-16 21:27:11 +02:00
Sean Kim
dd86ad6f23 Refactor: Introduce SculptBoundaryPreview
This commit adds SculptBoundaryPreview to reduce the scope of variables
that the SculptSession has access to when displaying the preview for
using the Boundary brush. Further changes in this area will be made once
more of the relevant flood_fill and boundary code is refactored.

In particular, the main algorithm does not need the edge position data.

Pull Request: https://projects.blender.org/blender/blender/pulls/124759
2024-07-16 21:22:00 +02:00
Clément Foucault
2718f24b5c EEVEE: Fix regression with negative colors in closures 2024-07-16 19:08:08 +02:00
Hans Goudey
1aff9bd9bb Cleanup: Sculpt: Remove unused functions 2024-07-16 11:59:58 -04:00
Hans Goudey
5bd7560894 Sculpt: use new brush API for the rest of the layer brush
Part of #118145.
Replace the PBVH vertex iterator macro.
2024-07-16 11:59:58 -04:00
Hans Goudey
b7ce539305 Refactor: Sculpt: Use local array of displacement factors in layer brush 2024-07-16 11:59:58 -04:00
Hans Goudey
3983486ecc Cleanup: Sculpt: Use local array of masks in layer brush 2024-07-16 11:59:58 -04:00
Hans Goudey
154be4ceef Refactor: Sculpt: Pass attributes directly for layer brush persistent base
Part of #118145.
2024-07-16 11:59:58 -04:00
Hans Goudey
5077df7dbc Cleanup: Sculpt: Remove unnecessary layer brush absolute value operation
The factors are always positive already.
2024-07-16 11:59:57 -04:00
Hans Goudey
2375dfa06e Cleanup: Sculpt: Reduce variable scope 2024-07-16 11:59:57 -04:00
Hans Goudey
d3b2fd5a65 Refactor: Sculpt: Extract persistent base check from layer brush loop 2024-07-16 11:59:57 -04:00
Hans Goudey
17f3f7bbec Cleanup: Sculpt: Use new original position accessors in layer brush 2024-07-16 11:59:57 -04:00
Hans Goudey
dbefe94c04 Cleanup: Sculpt: Pass displacement factor explicitly in layer brush
Since this is such important data for the brush, it's clearer if it's an
argument rather than accessed from the stroke cache for every
vertex.
2024-07-16 11:59:57 -04:00
Hans Goudey
0161a19669 Refactor: Sculpt: Use new API for layer brush factors
Part of #118145.
2024-07-16 11:59:57 -04:00
Hans Goudey
0c6d7fc7d5 Refactor: Sculpt: Specialize layer brush implementation per PBVH type
Part of #118145.
The persistent base only works for base mesh sculpting, so for the other
data structure that code path is removed.
2024-07-16 11:59:57 -04:00
Hans Goudey
73784365f5 Cleanup: Sculpt: Layer brush argument naming, order, use references 2024-07-16 11:59:57 -04:00
Hans Goudey
1184f21979 Cleanup: Sculpt: Use C++ math types/functions for layer brush 2024-07-16 11:59:57 -04:00
Hans Goudey
6b80654c32 Cleanup: Sculpt: Move layer brush to separate file 2024-07-16 11:59:57 -04:00
Clément Foucault
c72a1d698e EEVEE: Improve Pixel Size Upscaling
This fixes a few issues and clear up some confusion
in the code.

Note that this changes the behavior of render region;
they now reduce the internal render size. This is
matching the new design documentation.

- Data passes have correct accumulation.
- Adhere to naming conventions for extents, film and render pixels.
- Jitter over final pixels first before doing random sampling
  in order to speed up convergence.
- Ensure enough sample to cover at least all the film pixels once.
- Always include the four neighbor pixels in case one is nearer.
- Fix projection matrix computation to align overscan pixels.

Pull Request: https://projects.blender.org/blender/blender/pulls/124735
2024-07-16 16:59:00 +02:00
Jeroen Bakker
ca0e1d696a Vulkan: Layer tracking during render scope
EEVEE can bind layers of a texture that is also used as an attachment. When binding
the image layout of these specific layers can be different that the image layout of
the whole image.

This fixes the known synchronization issues inside EEVEE. wasp_bot, tree_creature and
wanderer scenes can be rendered without any synchronization issue reported by the
Vulkan validation layers.

Design task: #124214

When beginning to render the attachments are being evaluated. If there is an arrayed
texture (with multiple layers) the individual layers of that texture can be tracked
during until the rendering is ended.

When the same texture is bound to a shader it will be a different layer (otherwise
there is a feedback loop, which isn't allowed). The bound layers will typically need
a different layout the transition to the new layout is executed and recorded. When
the rendering ends, the layers are transitioned back to the layout the texture is
expected in.

It can happen that a layer is used multiple times during the same rendering. In
that case the rendering should be suspended to perform the transition. Image layout
transitions are not allowed during rendering.

There is one place where a layer needs to be transited multiple times that is when
EEVEE wants to extract the thickness from the shadow. The thickness is stored inside
the gbuffer_normal which is also used as an attachment. Eval then samples the thickness
from the gbuffer_normal as a sampler. To work around this issue we suspend the rendering
when a `GPU_BARRIER_SHADER_IMAGE_ACCESS` is signaled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124407
2024-07-16 16:39:18 +02:00
Germano Cavalcante
e7fa847bba Fix #124552: Incorrect snap symbol
Basically the problem was caused by using `|=` instead of `=`.

This commit also improves the mixed snap case for Mindpoint and
Perpendicular without Edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/124627
2024-07-16 10:46:23 -03:00
Jacques Lucke
31aa0f9a5d Cleanup: replace GHash with Map for determining library indices
This simplifies the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/124776
2024-07-16 14:32:12 +02:00
Aras Pranckevicius
ce9becae4c Fix: VSE thumbnails broken due to recent retiming draw changes
Retiming draw order changes in d0cf4a4a8b accidentally broke VSE
thumbnails. The order of drawing became "for each strip: draw thumbnail,
draw retiming continuity".

But the "draw retiming" bit was changing the projection matrix, which
placed all the later thumbnails at nonsensical locations.

Fixup it so that:
- First all thumbnails are drawn, then all retiming continuities.
- Retiming continuity drawing sets up matrix just once, instead of
  doing all that work for each strip.
- And it also restores the previous projection matrix after it is done.
- Also, can_draw_retiming now says "false" when no retiming keys are
  present. Previously, code was going into possibly expensive drawing
  setup for any strip, even when the is nothing to draw.

Pull Request: https://projects.blender.org/blender/blender/pulls/124780
2024-07-16 14:02:15 +02:00
Christoph Lendenfeld
ba4b15c712 Fix: Layered Action - deleting keys not working without keyingset
When trying to delete keys from a layered action in the viewport
using ALT+I and no keyingset is set, no keys would be deleted.
That is because the code hasn't been updated to work with layered actions yet.
The fix is to check if the action is layered and iterate the
FCurves depending on how they are stored.
For this to work nicely I had to extract the function `delete_key_fcurve`.

Pull Request: https://projects.blender.org/blender/blender/pulls/124619
2024-07-16 13:58:09 +02:00
Sybren A. Stüvel
cf2dcc792c Anim: change DNA name channelbags_array to singular channelbag_array
All the arrays in the new Action DNA are named singularly (`layer_array`,
`fcurve_array` etc). `channelbags_array` was the only plural one. For
consistency, this is now also singular.

Note that this is a backward-incompatible change, and will effectively
erase all animation from layered Actions. No effort is taken to handle this
rename as the feature is still in its experimental phase.

Action and slot assignments are not affected by this change.

Apart from the lack of backward compatibility, no functional changes are
expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/124768
2024-07-16 13:24:23 +02:00