Commit Graph

139195 Commits

Author SHA1 Message Date
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
Pratik Borhade
3875ceb280 Fix #124647: UV editing console error due to missing enum
IMAGE_AST_brush_paint poll should check context.space_data.mode
rather than context.space_data.ui_mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/124762
2024-07-16 19:23:22 +02:00
Clément Foucault
2718f24b5c EEVEE: Fix regression with negative colors in closures 2024-07-16 19:08:08 +02:00
Jesse Yurkovich
138e914346 Fix #124745: Wrong stack offset for Voronoi lacunarity parameter
This would cause values plugged into the Smoothness socket to also be
used for Lacunarity.

Pull Request: https://projects.blender.org/blender/blender/pulls/124761
2024-07-16 18:58:25 +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
97b52fb204 EEVEE: Update tests 2024-07-16 17:55:47 +02: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
il4n
41a61aa4aa Fix: VSE: Overlap when using reset retiming on strip with effect strips
If a strip had effect strips applied on it, and using the reset
retiming operator caused the strips to increase in length, the effect
strips would become overlapped with any strips they hit, unless the
"Expand" overlap mode was used.

This is because the "effect chain" strips weren't included
in #strips.

Co-authored-by: Richard Antalik <richardantalik@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/124750
2024-07-16 13:10:28 +02:00
il4n
e2934ee29f Fix: Reset retiming doesn't update effect strip and meta strip ranges
Pull Request: https://projects.blender.org/blender/blender/pulls/124749
2024-07-16 13:04:48 +02:00
Christoph Lendenfeld
b2cedb891e Fix #124686: Armature wire width not working with curves
This was originally fixed in 8ecccddf1c but for some reason
the merge to main didn't include those changes
merge commit: 2e03ca4a5b

The issue was that the wire width was not passed to the shader when using curve objects.

This PR is just the cherry picked changes from the original commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/124774
2024-07-16 12:59:42 +02:00
John Kiril Swenson
471a148666 VSE: Fix glitchy handle select for adjacent strips
For very small hotspot regions when trying to select handles on adjacent
strips, selection can sometimes jump to the strip farthest away from the
current mouse cursor position. This happens regardless of "Tweak
Handles" setting, but is most noticeable when it is off.

In the case that two strips are selected at once (which is possible
because internally strip handles are shifted away from the strip body by
a third of the handle size), `mouseover_strips_sorted_get` attempts to
sort these strips to maintain priority, but the logic was backwards --
fix the glitch by sorting strips such that the first strip in the
`Vector` is always the strip closest to the mouse cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/124708
2024-07-16 12:25:15 +02:00
il4n
0935baee36 Fix: VSE: Memory leak in SEQ_retiming_data_clear
Pull Request: https://projects.blender.org/blender/blender/pulls/124744
2024-07-16 12:24:16 +02:00
il4n
2d6d62da18 Refactor: Move code into new SEQ_retiming_reset function
This is so that internal functions can be used to fix bugs in the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/124748
2024-07-16 12:20:47 +02:00
Julian Eisel
21aeb9e454 Fix: Duplicating brush asset wouldn't display it as active
Was using the old, not the modified name of the brush to build the brush
asset reference, that is used to identify the active brush asset.

The new brush was actually activated, but some of the UI like the asset
shelf would display it as such.
2024-07-16 11:57:26 +02:00
YimingWu
5a60e3f439 Fix #124297: GPv3: Build modifier natural drawing speed fix
The fix contains two parts:

1. Grease Pencil v3 now stores stroke `init_time` as a float attribute,
   it's not enough precisiton for unix timestamp. Now the time value is
   truncated to allow better precision. It's still stored in seconds.
2. The previous logic for calculating stroke gap time of the build
   modifier isn't correct, it used to only count two starting times as
   gap time. Now it's fixed with correct delta time.

Pull Request: https://projects.blender.org/blender/blender/pulls/124350
2024-07-16 10:26:31 +02:00
Jacques Lucke
c3f79ee250 Geometry Nodes: support simulating and baking grease pencil geometry
This adds support using grease pencil in simulation zones and bake nodes.
The code is very similar to the code of the other geometry types.

Pull Request: https://projects.blender.org/blender/blender/pulls/124670
2024-07-16 10:11:48 +02:00
Iliya Katueshenock
81de8f388e Fix: Geometry Nodes: Field inferencing takes dangling reroutes into account
Fix is to ignore dangling reroutes for sockets which have an implicit field input.

Pull Request: https://projects.blender.org/blender/blender/pulls/124742
2024-07-16 09:52:57 +02:00
Campbell Barton
eaa5542314 Merge branch 'blender-v4.2-release' 2024-07-16 17:50:47 +10:00
Campbell Barton
bf738fd35a Build: add missing ROCm installation step 2024-07-16 17:50:03 +10:00
Iliya Katueshenock
9a2ff022a7 Fix: Nodes: Lack of dash on fields links
Regression after 24dc9a21b1.

Pull Request: https://projects.blender.org/blender/blender/pulls/124740
2024-07-16 09:47:15 +02:00
Alaska
ef010da315 Cycles tests: Enable MNEE test on Metal on supported macOS version
MNEE tests were disabled on Metal due to the feature not being
supported in macOS < 13.

This commit enables MNEE tests on Metal GPUs if they are using
macOS >= 13, otherwise leave it disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124709
2024-07-16 09:46:12 +02:00
Sergey Sharybin
047568f633 Cycles: Add an assert for DeviceString construction
The motivation is to be able to catch issues like #124705 early on,
by relying on asserts.

The not-so-obvious part of the change is the change in the order of
includes, which is needed for the types.h to have definition of the
kernel_assert().

Pull Request: https://projects.blender.org/blender/blender/pulls/124729
2024-07-16 09:43:28 +02:00
Aaron Carlisle
63435d19e9 Merge branch 'blender-v4.2-release' 2024-07-16 02:23:40 -04:00
Aaron Carlisle
a51f293548 Docs: Fix RNA to manual mapping
a39fa10b5b used the 4.3 manual instead of 4.2
2024-07-16 02:20:19 -04:00
Campbell Barton
fd5780e97b PyAPI: add bpy.utils.register_preset_path utility function
Support add-ons including their own preset paths,
needed to resolve #124020.
2024-07-16 15:50:28 +10:00
Sean Kim
e18dcef38d Cleanup: Reduce usage of initial_vert
Pull Request: https://projects.blender.org/blender/blender/pulls/124756
2024-07-16 04:28:52 +02:00
Sean Kim
cf656ac040 Refactor: Use float3 instead of PBVHVertRef for pivot_vertex
This commit removes the extra initial_pivot_position variable from
SculptBoundary as well as the PBVHVertRef in favor of a single float3.
This value is effectively const for the lifetime of the struct in the
current state, as this value is only calculated and used at the
beginning of the brush stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/124755
2024-07-16 04:20:22 +02:00
Sean Kim
c20b8f5d6e Refactor: Replace SculptBoundaryPreviewEdge with std::pair
This commit replaces the PBVHVertRef with specific float3 positions for
the edges. To ensure data is displayed correctly, we also remove the
conditional check on updating this data when drawing the cursor to
force recaculating the edge positions on the start of every brush
stroke.

Pull Request: https://projects.blender.org/blender/blender/pulls/124754
2024-07-16 03:40:49 +02:00
Thomas Dinges
a49efc5b17 Release: Bump to 4.2 release. 2024-07-15 21:25:41 +02:00