Commit Graph

117372 Commits

Author SHA1 Message Date
Guillermo Venegas
f2b6b6c232 UI: Prevent button vector reallocations on redraws
A bunch of reallocations can be avoided this way, usually the amount of buttons
is quite similar over redraws.

Pull Request: https://projects.blender.org/blender/blender/pulls/134580
2025-02-17 16:03:45 +01:00
Omar Emara
8dbd607df5 Merge branch 'blender-v4.4-release' 2025-02-17 16:57:36 +02:00
Omar Emara
003fb98f9d Fix #134567: Compositor memory leak in some setups
The compositor leaks memory in certain setups where a transformed result
is linked to two inputs in the same pixel node. This happens due to an
overestimation in the computation of reference counts of those results.
Since pixel operations might share the same input for multiple links in
the node tree, the reference count should be corrected to take that
sharing into account.

This sharing was previously accounted for as part of releasing inputs in
the pixel operation, but input processors didn't take that into account,
so the realize on domain input processor would leak memory. So to fix
this, we correct the reference count at the evaluator level instead,
such that input processors can safely operate on the correct reference
count.

Pull Request: https://projects.blender.org/blender/blender/pulls/134666
2025-02-17 15:55:22 +01:00
Clément Foucault
2cd15cdfef Overlay: Remove static GPUVertFormat
Makes this code threadsafe
2025-02-17 14:53:18 +01:00
Clément Foucault
b73c06ada0 Fix: Metal: Avoid overriding GPU matrices after shader bind
This was a bad usage of the Matrix API.
This fixes 2D and 3D cursor being broken on Metal.
2025-02-17 14:47:15 +01:00
Jeroen Bakker
51dc3063bf Merge branch 'blender-v4.4-release' 2025-02-17 14:14:45 +01:00
Jeroen Bakker
ed5b077f92 Fix #134634: Overlay: Mask not drawing on top of render result/viewer
Logical error in the overlay engine. Moved mask drawing before the early
exit for viewer/render results.

Pull Request: https://projects.blender.org/blender/blender/pulls/134660
2025-02-17 14:14:12 +01:00
Jacques Lucke
cb96dc34fa Merge branch 'blender-v4.4-release' 2025-02-17 12:38:50 +01:00
Clément Foucault
5b6f4d4759 Cleanup: DRW: Remove unused API functions
Pull Request: https://projects.blender.org/blender/blender/pulls/134461
2025-02-17 12:37:53 +01:00
Jacques Lucke
78b5c47c46 Fix #134669: crash because of dangling socket declaration pointer 2025-02-17 12:37:23 +01:00
Clément Foucault
d3b3cbec84 Sequencer: Move 2D cursor drawing from DRW to sequencer using IMM API
This avoid the dependency on the draw module and remove the
access to a global variable.

# Conflicts:
#	source/blender/editors/space_sequencer/space_sequencer.cc
2025-02-17 12:37:19 +01:00
Clément Foucault
38ce310c17 Overlay: Move 3D cursor drawing to the overlay engine
This is the more logical place and remove the use of the global
batch cache.
2025-02-17 12:36:34 +01:00
Clément Foucault
28ad3736e8 DRW: Move cube batch generation to GPU module
Avoid access on global DRWShapeCache and still
share the code for batch creation.
Each module is then responsible owner of their
own batch.
2025-02-17 12:36:34 +01:00
Clément Foucault
e55897448a DRW: Move sphere batch generation to EEVEE
Avoid access on global DRWShapeCache.
2025-02-17 12:36:34 +01:00
Clément Foucault
c91d60cda5 DRW: Move procedural batch to GPUContext
This remove relying on a global for storing
the batch and allow for more streamlined usage
of procedural drawing.
2025-02-17 12:36:34 +01:00
Clément Foucault
db920add50 Cleanup: DRW: Remove unused functions and batch inside the shape cache
These are not used since Overlay next that handles its own shape cache.
2025-02-17 12:36:33 +01:00
Richard Antalik
2a44bdfbd0 Refactor: Use C++ types for vectors strip image transform code
All 2D vectors related to image transform code were changed to float2.
Previously, it was decided, that 4x4 matrix should be used for 2D
affine transform, but this is changed to 3x3 now.

Texture painting code did rely on `IMB_transform` with 4x4 matrix.
To avoid large changes, I have added function
`BLI_rctf_transform_calc_m3_pivot_min`.

Main motivation is cleaner code - ease of use of c++ API, and avoiding
returning values by arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/133692
2025-02-17 11:23:00 +01:00
Andrej730
b9bbf48841 Fix: PyDocs typing issue with lists
Fixed use of lists using multiple arguments - `list` only
support a single argument.

Noticed working with fake-bpy-module - providing multiple
arguments to `list` resulted in typing error (e.g. "Too many type
arguments provided for "list"; expected 1 but received 2").

Pull Request: https://projects.blender.org/blender/blender/pulls/134663
2025-02-17 10:58:11 +01:00
Falk David
1a071ef755 Fix #134490: Grease Pencil: Clone brush in sculpt mode not working
The main issue was that the code was using
`foreach_editable_drawing_with_automask` which shouldn't have been
the case since there is no "masking" to be done when pasting strokes.

Additionally the code was computing the view position of every
pasted point and then computing the offset to move the points to the
mouse position.

Instead, we compute the center of the 3d bounds of the pasted strokes
and then project only the center to the view. From there we can offset
all the points to move them under the mouse cursor.

It's a bit weird to do this projection of the center to the view and
I believe we mainly do it to reuse the `DeltaProjectionFunc`.
There are cases where the projection of the center to the view will fail
which can lead to unexpected behavior on the user end. For now we
just leave the pasted strokes where they were copied from, which
isn't ideal. But this can be improved later.

Pull Request: https://projects.blender.org/blender/blender/pulls/134589
2025-02-17 10:38:02 +01:00
Jeroen Bakker
f89a075015 Merge branch 'blender-v4.4-release' 2025-02-17 08:58:44 +01:00
Jeroen Bakker
0faba244a5 Fix: Vulkan: Async readback of storage buffers
The vulkan backend was implemented with async in mind, however the one place
where Blender uses for async was implemented blocking. This PR splits the
readback into flushing the command and waiting for readback.

**Performance**

Improvement of animation playback performance of shader balls.blend is around 10%.
Shader balls.blend frame: 1-100, 10 x animation playback

| Branch               | Total time | Average time |
| -------------------- | ---------- | ------------ |
| blender-v4.4-release | 26851 ms   | 2685 ms      |
| This PR              | 23675 ms   | 2367 ms      |

Pull Request: https://projects.blender.org/blender/blender/pulls/134227
2025-02-17 08:58:06 +01:00
Dalai Felinto
645242dcc4 Fix: Point cloud keymap not working
Pull Request: https://projects.blender.org/blender/blender/pulls/134638
2025-02-17 08:44:05 +01:00
Hans Goudey
cd04584412 Point Cloud: Implement transform operator
This ends up being very simple because point cloud has
no connectivity information and each element is just one
position.

Also implement the 3D transform gizmo.

The geometry deformation system isn't implemented in this
commit. That can be tacked later.
2025-02-16 23:36:04 -05:00
Hans Goudey
62b568d393 Point Cloud: Implement box, circle, lasso select tools
Signficantly simplified versions of the similar curves code.
These require #134623 to function.
2025-02-16 22:48:35 -05:00
Hans Goudey
75be98a4dc Point Cloud: Implement "Set Attribute" operator
Similar to the mesh and curves operators of the same name.
2025-02-16 21:28:53 -05:00
Hans Goudey
aff784aa14 Point Cloud: Implement "Affect only Origins" object transform option
Basically the same code as the curves support in this area.
2025-02-16 20:48:46 -05:00
Hans Goudey
c1c67c918e Refactor: Various C++ cleanups to object data transform
Make `XFormObjectData` a real virtual struct instead of using
C style over-allocation. Use C++ arrays and math types.
2025-02-16 20:31:09 -05:00
Hans Goudey
a369397301 Sculpt: Reduce overhead for multires index buffer creation
Avoid calling `GPU_indexbuf_add_line_verts` and the triangle
version of that function. It's faster to avoid function calls and
just write to the data arrays directly. I did some very rough tests
and observed about a 10% improvement in runtime for the
entire index buffer creation process.
2025-02-16 18:51:14 -05:00
Campbell Barton
c97a2e86a9 Merge branch 'blender-v4.4-release' 2025-02-16 21:00:42 +11:00
Campbell Barton
665b4dfbad Fix IDProperty comparison warning in debug mode
The warning to check if two numbers are nearly equal when comparing
floats didn't take negative numbers into account, causing -1.0 & 0.0
for e.g. to be considered not equal but close.
This also resolves a divide by zero.
2025-02-16 20:56:07 +11:00
Campbell Barton
5087246f39 Cleanup: strip trailing space, sort file lists 2025-02-16 20:42:16 +11:00
Campbell Barton
4c5424d9fc Merge branch 'blender-v4.4-release' 2025-02-16 19:45:34 +11:00
Campbell Barton
a80bd2744d Fix incorrect null checks in animadata::find_related_ids 2025-02-16 19:39:44 +11:00
Pratik Borhade
f209902866 Merge branch 'blender-v4.4-release' 2025-02-16 13:30:32 +05:30
Pratik Borhade
9dddef9581 Fix #134316: Color being sampled from hidden faces in texture paint
If face that has been hit is hidden, skip sampling from the face,
instead use current pixel color.

Pull Request: https://projects.blender.org/blender/blender/pulls/134321
2025-02-16 08:58:52 +01:00
Campbell Barton
69e63d190d Cleanup: use "at_most" RNA array access functions for simplicity 2025-02-16 18:39:35 +11:00
Campbell Barton
a8feffdc18 RNA: add array get/set functions that limit the number of elements
Add the corresponding int/boolean functions for
RNA_property_float_{get/set}_array_at_most functions.
2025-02-16 18:39:33 +11:00
Campbell Barton
3b11f5dc44 Cleanup: use a const argv in main() for WIN32 matching other systems
Avoid casting `argv` to a `const char **` when passed to functions.
2025-02-16 18:39:31 +11:00
Campbell Barton
efd46c86a9 Cleanup: pass arguments by const reference instead of value 2025-02-16 18:39:30 +11:00
Campbell Barton
9b0df7c60a Merge branch 'blender-v4.4-release' 2025-02-16 18:32:17 +11:00
Campbell Barton
c80980d10b Fix #125376: Standalone bpy module can crash on exit 2025-02-16 18:27:02 +11:00
Campbell Barton
d02f957296 Merge branch 'blender-v4.4-release' 2025-02-16 17:17:56 +11:00
Campbell Barton
78ccea432f UI: correct array size check for colors
Allow arrays to be larger than 4.

Related to #134537.
2025-02-16 17:14:12 +11:00
илья _
a0b9071413 Cleanup: Sculpt: Avoid unnecessary copy
Unlike to view containers like span, or implicitly shared containers like virtual array, this is simple container which is unique owner the memory. So its copy here also lead to N/8-bytes copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/134617
2025-02-16 03:26:53 +01:00
Dalai Felinto
1e87818808 Point Cloud: Select All/None/Invert
Select All operator and boiler plate for future point cloud operators.

The selection code is basically copied/inspired by the curves selection
code. A lot of it could probably be moved to shared attribute selection
functions.

Note, while this patch is working well, there are some caveats
to test it:

* Shortcuts are being defined (you can see them in the Preferences). Yet
  they are not working for whatever reason.

* There is no way to visualize the selection. I've been testing it by
  using a Nodes tool that changes the material based on selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/134450
2025-02-15 12:36:39 +01:00
Richard Antalik
564feceffd Cleanup: Use float instead of double for VSE retiming step
After calculating precision error, it turns out, that float type is
capable of working with up to 100h of 60fps footage without problems.

Pull Request: https://projects.blender.org/blender/blender/pulls/134477
2025-02-15 09:53:58 +01:00
Sean Kim
03a2d675a7 Fix #134591: Node tool crashes when modifying mesh topology
Caused by 0b891a68b1

In certain cases, we need to perform a whole-geometry update to the
underlying mesh data. The prior commit cleared the paint BVH but did not
tag the depsgraph for geometry updates, causing incorrect data to be
used while rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/134597
2025-02-15 02:27:35 +01:00
Harley Acheson
beaaa428e9 UI: Tightened Status Bar Spacing
Slight adjustments to the spacing of items on the Status Bar. Mainly
to reduce the distance between adjoining icons. Small decrease in space
between icon and text. Slight decrease in text size inside the event
icons. Proportionally wider gap between items.

Pull Request: https://projects.blender.org/blender/blender/pulls/134534
2025-02-15 00:57:49 +01:00
Hans Goudey
3a542c9396 Merge branch 'blender-v4.4-release' 2025-02-14 15:44:59 -05:00
Hans Goudey
77ed7bfca5 Fix: Incorrect selection field type in Set Selection node
The selection can be float or boolean for these geometry types.
At the very least this caused asserts in debug builds.
2025-02-14 15:43:19 -05:00