Commit Graph

110714 Commits

Author SHA1 Message Date
Jeroen Bakker
78f37fe331 Vulkan: Fix incorrect image aspect
When clearing only the depth of a depth/stencil only the depth
part of the image aspect was stored in the node. This is invalid
when the image needed to be transitioned.

Pull Request: https://projects.blender.org/blender/blender/pulls/123713
2024-06-25 11:05:24 +02:00
Jeroen Bakker
f5b173188e Vulkan: Fix incorrect read image barrier
When having a sequential read image barriers for the same resource
and the second one requires an image layout transition the incorrect
barriers where generated.

This was fixed by aligning the implementation with write image barriers.

Pull Request: https://projects.blender.org/blender/blender/pulls/123712
2024-06-25 11:05:07 +02:00
Campbell Barton
6fe666f773 Merge branch 'blender-v4.2-release' 2024-06-25 15:56:00 +10:00
Campbell Barton
4712aca2a8 Fix #123682: extension repo URL/access token changes don't re-sync
When changing the URL or access token, re-synchronize remote data
automatically.

This changes automatic synchronization to use a background task that
runs based on a timer instead of a modal operator since the operator
is more intrusive and not so well suited to running based on changes
to RNA.
2024-06-25 15:52:04 +10:00
Sean Kim
d863785775 Merge branch 'blender-v4.2-release' 2024-06-24 13:58:36 -07:00
Sean Kim
2cc6de8f7e Fix #123574: Automask area normal causes garbled meshes
Pull Request: https://projects.blender.org/blender/blender/pulls/123697
2024-06-24 22:57:09 +02:00
Hans Goudey
4919b5681d Merge branch 'blender-v4.2-release' 2024-06-24 15:39:02 -04:00
Hans Goudey
1b80125a67 Fix: Leak of initialized but not pushed undo step
In some cases, sculpt code currently creates undo steps that are stored
in `step_init` in the undo stack, but then skips actually pushing them.
That can happen when an operator is cancelled (like the transform
operator in #123172) or because pushes in "nested operator calls"
are currently explicitly disabled. That happens when calling the brush
operator from a script.

It turns out the undo code never freed the `step_init`, probably because
it assumed it would be pushed to be part of the stack afterwards.

Personally I'm not convinced that separating undo step creation into
two stages with `step_encode_init` and `step_encode` is a great design
or a necessary one, but I'm trying not to get into that deeper right now.

Fixes #123172

Pull Request: https://projects.blender.org/blender/blender/pulls/123331
2024-06-24 21:38:21 +02:00
Hans Goudey
59d84a4c42 Fix: Sculpt: Various issues with undo
Fixes #123612, #123611, #123621

Continue the restructuring in previous commits in this area to avoid
repeating more work for every node. The commit is large for a bug fix
but the best way to fix the issues was to continue making the area more
generally sane. Some specific changes:
- Run the switch for undo type outside of the iteration over nodes.
- Further split multires and base mesh undo so they don't go through
  the same per-node functions.
- Replace the node-tagging mechanism with specific loops per undo type.
- Properly assign the step type when pushing a single node at a time.
2024-06-24 14:32:12 -04:00
Brecht Van Lommel
0f63085d9d Merge branch 'blender-v4.2-release' 2024-06-24 20:02:59 +02:00
Clément Foucault
0b7ae0c75a EEVEE: Reduce binary size on Mesa caused by fixed size arrays
For some reasons this reduce the binary size from 11MB for
the 3 shaders to less than 1MB.
2024-06-24 19:31:33 +02:00
Bastien Montagne
65c5721c5a Fix (unreported): MEM_new/MEM_freeN mistaches.
Calling `MEM_freeN` on data allocated with `MEM_new` is bad, since it
will not call a destructor matching the one invoked as part of
`MEM_new`.

While in practice cases fixed below were 'not a problem' currently, as
they are trivial Cpp types (and therefore their destructor is doing
nothing), `MEM_freeN` has no way to ensure it is dealing with such a
trivial data type, so allowing such mismatch is dirty and dangerous.

Note that almost all fixed cases look more like unintentional mistakes
(mis-usages of `MEM_new` instead of `MEM_cnew`).

NOTE: There is one more (known!) case in the asset code, which fix is
slightly less trivial, and will go through a separate PR.

NOTE: This is a by-product of some work to detect such invalid usages of
`MEM_freeN` on memory chunks allocated with `MEM_new`.

Pull Request: https://projects.blender.org/blender/blender/pulls/123691
2024-06-24 18:42:26 +02:00
Miguel Pozo
62293d76bb Merge branch 'blender-v4.2-release' 2024-06-24 18:35:52 +02:00
Sean Kim
e140f263d0 Fix #122856: Sculpt trim and filter tools do not show brush cursor
This commit adds a new poll function specifically for determining if the
sculpt cursor should be drawn. This function whitelists a hardcoded set
of non-brush operators to display the cursor for.

In testing, this extra check has negligable performance impact. On
average it takes 0.012ms per execution.

Pull Request: https://projects.blender.org/blender/blender/pulls/123570
2024-06-24 18:33:49 +02:00
Miguel Pozo
d88150ce1f Fix: GPU: Skip binaries larger than the shared memory 2024-06-24 18:33:05 +02:00
Damien Picard
65de0db503 I18n: translate mouse and NDOF events in the keymap preferences
Mouse and NDOF events are defined in enums that are never used
directly by RNA through RNA_def_property_enum_items. As a result, they
don't get automatically extracted to the translation files and need to
be manually, through N_() macros.

The translation context used is the same as in other places related to
KeyMapItem: "UI_Events_KeyMaps".

Pull Request: https://projects.blender.org/blender/blender/pulls/116390
2024-06-24 18:10:39 +02:00
Falk David
9ffb277e01 GPv3: Draw Tool: Jitter option
This adds the `Jitter` draw tool option in the randomize panel.

To make this work in combination with the active smoothing, the jitter of the positions is applied
after active smoothing as an effect on top.
This means that the active smooth will not smooth the jittered points.

In addition, it is also now allowed to raise the `Jitter` factor above 1 for a more extreme effect.

Note: The jittering worked a bit differently in GPv2 (probably because of a bug). In GPv3 we compute the cotangent using the smoothed stroke direction (over time), which is a lot more acurate then using the previous and current position for the direction.

Pull Request: https://projects.blender.org/blender/blender/pulls/123680
2024-06-24 16:32:13 +02:00
Devashish Lal
3e28b6c7f1 Nodes: File path socket subtype for string sockets
This commit adds a new socket subtype for the string socket type
for file paths. Like other subtypes, this doesn't influence the data
stored in the socket or passed between nodes, it adds a file browser
popup operator to the socket button in the node.

From the file import nodes GSoC project:
https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482

Pull Request: https://projects.blender.org/blender/blender/pulls/123250
2024-06-24 16:28:33 +02:00
Lukas Tönne
4bb5cd365b Curves: Remove unnecessary to_static_type in resample code
Static type resolution is redundant here because
`interpolate_to_evaluated` takes generic spans anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/123662
2024-06-24 14:58:40 +02:00
Hans Goudey
e14d153edf Cleanup: Formatting 2024-06-24 08:42:07 -04:00
Sergey Sharybin
8c430a7a67 Depsgraph: Optimize composite and render pipeline depsgraph
The idea is to skip building data-blocks referenced by ID
properties for dependency graphs used by render pipeline and
compositor preview. Those graphs do not use handlers, so it
is not required to have custom references to data-blocks
evaluated.

This solves an initial hicckup and memory usage with file
from #121188 when doing compositor. It also reduces the time
until first pixel when hitting F12 on that file.

Pull Request: https://projects.blender.org/blender/blender/pulls/123439
2024-06-24 14:22:47 +02:00
Jeroen Bakker
55ac7fd6fd Vulkan: Early exit clearing stencils
Adds an early exit when clearing stencils on textures that don't have
a stencil aspect. This is the case when rendering EEVEE planar probes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123668
2024-06-24 14:19:24 +02:00
Jeroen Bakker
30ec6ac961 EEVEE: Missing resource when tracing planar probes
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/123667
2024-06-24 14:18:26 +02:00
casey bianco-davis
371e419aa4 Fix: #122183: GPv3: Primitive vertex color not working on fills
This makes vertex color for stroke and fill work properly with all primitive tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/123516
2024-06-24 13:53:19 +02:00
casey bianco-davis
db9ce7392d GPv3: Use texture coordinates for primitive tools.
This make texture coordinates properly work with the primitive tools.

This uses the same placement logic as the draw tool.

Note: Placement is determent by the first point placed and will not be updated if that point is moved.
Pull Request: https://projects.blender.org/blender/blender/pulls/123520
2024-06-24 13:45:47 +02:00
Bastien Montagne
9688462349 Merge branch 'blender-v4.2-release' 2024-06-24 13:34:48 +02:00
Bastien Montagne
a94798d31c Fix (unreported) assert in recursive 'foreach id' iterating code.
owner ID pointer needs to be reset after initial usage, for the
recursively processed 'children' IDs.
2024-06-24 13:33:21 +02:00
Philipp Oeser
a196f4276e Merge branch 'blender-v4.2-release' 2024-06-24 13:01:40 +02:00
Philipp Oeser
696848204c Fix #118148: STL/PLY: Imported object data has increased usercount
STL/PLY (also Collada) use `BKE_mesh_assign_object` to assign a mesh
(already in main, has a usercount of 1) to a fresh object.
That function does a bunch of (unneeded) things (test modifiers/
materials which is not necessary since these are fresh objects) next to
increasing usercount. Collada steers against this by reducing usercount
again. Other importers such as alembic assign the mesh directly to
object data (which is also what this PR proposes).

Pull Request: https://projects.blender.org/blender/blender/pulls/123558
2024-06-24 13:00:58 +02:00
Philipp Oeser
a09edde30d Merge branch 'blender-v4.2-release' 2024-06-24 13:00:13 +02:00
Jeroen Bakker
e4cfa1b8ba EEVEE: Subsurface missing bindings
Bindings where bound using incorrect naming. (out_indirect_img vs out_indirect_light_img).

Pull Request: https://projects.blender.org/blender/blender/pulls/123664
2024-06-24 12:54:26 +02:00
Falk David
f51aa8a2c7 Fix: GPv3: Eraser and Tint tool use wrong radius
The eraser and the tint tool were still using the unified paint settings.
This fixes the issue by making sure to use `brush->size` instead.
2024-06-24 12:51:03 +02:00
Jeroen Bakker
3eb15247fe Merge branch 'blender-v4.2-release' 2024-06-24 11:54:01 +02:00
Jeroen Bakker
1663df0c8f EEVEE: Ray generation missing resource
During ray tracing there is a missing resource. On OpenGL this doesn't
matter as it will reuse the previous binding. But on Metal or Vulkan
each resource needs to be added to update bindings.

Pull Request: https://projects.blender.org/blender/blender/pulls/123655
2024-06-24 11:51:31 +02:00
Jeroen Bakker
34a679d19f Vulkan: Read out of bound when using many resources
Internally the image and texture resources where kept in a vector
where the elements were referenced. When using more than 16 images
this vector is reallocated and previous references become invalid.

This is a quick fix and should be changed with something more
stable.

Pull Request: https://projects.blender.org/blender/blender/pulls/123656
2024-06-24 11:50:38 +02:00
Jacques Lucke
8d8a57332a Merge branch 'blender-v4.2-release' 2024-06-24 11:40:16 +02:00
Jacques Lucke
c1c3ed0e4b Fix #123542: memory display error
`mat4x4f` is not found when loading .blend files which were written
before this struct existed. The buffer-overwrite wrote into the buffer
size of our allocator (`MemHead`).
2024-06-24 11:38:59 +02:00
Lukas Tönne
a606f2fd09 Merge branch 'blender-v4.2-release' 2024-06-24 10:28:50 +02:00
Lukas Tönne
37e2a27bdd Fix #80876: Ocean modifier "Delete Bake" button does not work
The ocean modifier uses its Bake operator for both baking and freeing
the cache, based on the `free` operator property.

There are two bugs here:
1. The "Delete Bake" variant of the button was created using the
   `WM_OP_EXEC_DEFAULT` operator context. This skips the `invoke`
   callback which is crucial for setting the operator `modifier`
   property. Without that the modifier will just exit early.
   The "Bake" button is drawn using the `uiItemO` function which uses
   the invoke context automatically, so it does not have this issue.
2. The `free` property is set for the "Delete Bake" variant, but was
   never reset to its initial `false` value. The "Bake" variant has to
   also set this property, otherwise it will always execute the "free"
   code path.

Pull Request: https://projects.blender.org/blender/blender/pulls/123506
2024-06-24 10:27:28 +02:00
Jeroen Bakker
560b36ac8d EEVEE: Fix incorrect texture usage DoF
The color textures in the DoF module are also bound in gather
framebuffer but didn't got the correct usage flags resulting in
validation errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/123650
2024-06-24 10:08:10 +02:00
Jeroen Bakker
0c39a75634 Vulkan: Fix binding collision when mixing textures and images
Due to incompatible binding namespaces between Vulkan and OpenGL we
offset the images in the ubo list. In the previous implementation
this could still go wrong as the images and textures bindings where
sequential. When EEVEE binds resources it can also try to bind resources
that aren't valid for the current shader. In this case it was still
possible that the incorrect binding was chosen.

This is fixed by offsetting the images by a large number.

Pull Request: https://projects.blender.org/blender/blender/pulls/123649
2024-06-24 09:27:13 +02:00
Campbell Barton
4e734dc66d Merge branch 'blender-v4.2-release' 2024-06-24 12:36:44 +10:00
Campbell Barton
e48a9fc5ed Extensions: add missing update callbacks for repository flags
Enabling/disabling a repository wasn't redrawing when it should.
2024-06-24 12:14:48 +10:00
Lukas Stockner
b59fbbe865 Cleanup: Formatting 2024-06-24 00:38:11 +02:00
Lukas Stockner
26eb5d9899 EEVEE: Adapt Principled BSDF to closure sampling
With the new closure approach, the code can be simplified and cleaned up quite
a bit.

This also removes four parameters, which is helpful for future additions (!123616)
since the parameter limit appears to be reached.

Pull Request: https://projects.blender.org/blender/blender/pulls/123643
2024-06-24 00:20:30 +02:00
Pratik Borhade
6c2ffc526c GPv3: Copy layers to selected operator
Port `GPENCIL_OT_layer_duplicate_object` operator to new structure.
New function created to duplicate layer and its frames. This could also
be used in duplicate_layer operator later.

Part of #110056

Pull Request: https://projects.blender.org/blender/blender/pulls/123366
2024-06-23 07:42:15 +02:00
Campbell Barton
07de3d4499 Merge branch 'blender-v4.2-release' 2024-06-23 14:50:05 +10:00
Campbell Barton
52b63777a1 Extensions: use the full path for remote "file://" repositories
The logic to use a domain name was being applied to file:// paths,
causing only the first directory to be used.
2024-06-23 14:35:06 +10:00
Campbell Barton
428c525a41 Merge branch 'blender-v4.2-release' 2024-06-23 13:02:13 +10:00
Campbell Barton
f6b48e18f5 Merge branch 'blender-v4.2-release' 2024-06-23 13:02:10 +10:00