Commit Graph

120055 Commits

Author SHA1 Message Date
Philipp Oeser
d83944f248 Merge branch 'blender-v4.4-release' 2025-03-14 17:32:43 +01:00
Philipp Oeser
6f02a485aa Fix #135927: Crash moving empty slots to new action
Check existence of layer and slot before handling Channelbags.
The existing asserts dont catch this (they are skipping the "empty
layers" case) and rightfully so, think there might be usecases for
moving **empty** slots as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135963
2025-03-14 17:19:06 +01:00
Hans Goudey
e5d9b7a43f Cleanup: GPU: Remove unused index buffer function
This information is set when creating the indices,
there should be no need to compute it later.

Pull Request: https://projects.blender.org/blender/blender/pulls/135986
2025-03-14 16:55:55 +01:00
Julian Eisel
d14c677da3 Versioning: Bump subversion after previous commit
Followup to 4499fad40e.

Although no really necessary (the added versioning would be fine to
always run), still bump the subversion to avoid confusion about the
unversioned block.
2025-03-14 16:50:14 +01:00
Julian Eisel
4499fad40e UI: Horizontal list view for asset browser
Part of #134755 / #134766.

The asset browser currently lacks a compact view that leaves names
readable. Especially when managing asset libraries (e.g. to prepare it
for sharing or set up a production library), this is quite a usability
issue. A column view like the file browser has can solve this, allowing
a quick overview and fast browsing of libraries, while keeping names
readable.

Adds a new "Horizontal List" display mode to the asset browser that
distributes assets over multiple columns, with horizontal scrolling.
Asset previews are shown in this mode, plus an asset type icon if
there's enough space. The size of previews and the columns can be
configured next to the display mode, for optimizing the display.

Pull Request: https://projects.blender.org/blender/blender/pulls/135306
2025-03-14 16:43:12 +01:00
Philipp Oeser
8a0d34393d Fix #135969: Crash exporting Grease Pencil with no materials as SVG/PDF
Having no material is not uncommon, e.g. this can happen in blender when
a Curve is coverted to Grease Pencil.

If there is no material, we can still regard that stroke as visible, and use the
default Grease Pencil material in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/135975
2025-03-14 15:42:54 +01:00
Jun Mizutani
200e26ed15 Cleanup: the comma operator was used to separate assignment statements
This was a typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/135900
2025-03-14 15:34:14 +01:00
Julian Eisel
95c2daaac7 Cleanup: Move 3D View dropbox code into own file
There was quite a bit of drop-box code in `space_view3d.cc`. Moving it
to an own file makes files more focused & coherent, and keeps file sizes
more manageable.
2025-03-14 15:14:42 +01:00
Bastien Montagne
1e976ec37b Cleanup: io: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135976
2025-03-14 14:52:16 +01:00
Bastien Montagne
6ff1e227c8 Cleanup: makesdna: Replace 'void' MEM_[cm]allocN with templated, type-safe MEM_[cm]allocN<T>.
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.

This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.

MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.

NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.

Pull Request: https://projects.blender.org/blender/blender/pulls/135971
2025-03-14 12:48:52 +01:00
Jacques Lucke
e297e6dab3 Fix #135815: missing instance attribute propagation 2025-03-14 12:41:17 +01:00
Pratik Borhade
f5ceb3822a Grease Pencil: Stroke split operator
An operator to split selected points into a separate stroke.
Use `split_points()` function implemented in 2c42294557

Resolves #113643

Pull Request: https://projects.blender.org/blender/blender/pulls/135845
2025-03-14 12:37:25 +01:00
Jacques Lucke
1f223156ac Cleanup: add debug label 2025-03-14 12:21:34 +01:00
Habib Gahbiche
d8d09cdadb Geometry Nodes: shortcuts for viewer nodes
Implement shortcuts for viewer nodes. Viewer nodes are now activated using the operator `bpy.ops.node.activate_viewer()` instead of activating the viewer by setting the node to active.

This also unifies the behavior with viewer shortcuts in the compositor (see attachment in the original PR).

Pull Request: https://projects.blender.org/blender/blender/pulls/134555
2025-03-14 11:26:57 +01:00
Julian Eisel
18c4df0243 I18N: Make some property disabled hints translatable
This text will show in tooltips to explain why a property is not
editable, it needs to be tagged for translation.
2025-03-14 10:55:36 +01:00
Clément Foucault
626118984e Compositor: Use last_update for ID update
This replaces the deprecated DrawData mechanism by the
usage of the update timestamp `last_update`.

The compositor keeps the `last_update` value of the cached ID
and compares it with the value on the ID at the time of evaluation.

Rel #134690

Pull Request: https://projects.blender.org/blender/blender/pulls/134878
2025-03-14 10:25:32 +01:00
Jacques Lucke
c23cf12560 Cleanup: Nodes: simplify getting socket type from static type 2025-03-14 10:16:56 +01:00
Jacques Lucke
eb9d50d6a6 BLI: add implicit to-bool conversion for generic pointers
This way they behave more like regular pointers.
2025-03-14 10:16:55 +01:00
Omar Emara
b978f51051 Refactor: Compositor: Use BKE conversion for single values
This patch refactors the conversion code for single values to use BKE
conversion rules. This reduces boilerplate and makes it easier to add
new types.
2025-03-14 10:37:05 +02:00
Philipp Oeser
220e7481fb Merge branch 'blender-v4.4-release' 2025-03-14 09:18:49 +01:00
Philipp Oeser
fdd402c3d8 Fix #135863: Grease Pencil Tint Modifier ignores custom curve influence
Seems this was just forgotten in baeb4d7753

To resolve, do the same as done for the "Hue/Saturation" or "Opacity"
modifiers (calculate factor along curve and evaluate curmapping).

Pull Request: https://projects.blender.org/blender/blender/pulls/135871
2025-03-14 09:18:32 +01:00
Philipp Oeser
98ab9c26c1 Fix #135857: "Affect only origins" fail for non-poly grease pencil curve
If we tag positions to be changed we get a proper update (was probably
working for poly curves because the evaluated positions just reference
the original positions array when all curves are poly curves).

Pull Request: https://projects.blender.org/blender/blender/pulls/135874
2025-03-14 09:18:01 +01:00
Sean Kim
fed2364d18 Fix #135931: Paint brush with gravity factor can crash Blender
This commit prevents the "Gravity" value from having an effect on
brushes that are based on either the Paint or Smear brush in addition to
the ones that are already filtered. Prior versions of blender don't
crash, but still deformed the mesh, which is unexpected & undesired.

Pull Request: https://projects.blender.org/blender/blender/pulls/135944
2025-03-13 20:51:24 -07:00
Sean Kim
07e8b39330 Fix #135931: Paint brush with gravity factor can crash Blender
This commit prevents the "Gravity" value from having an effect on
brushes that are based on either the Paint or Smear brush in addition to
the ones that are already filtered. Prior versions of blender don't
crash, but still deformed the mesh, which is unexpected & undesired.

Pull Request: https://projects.blender.org/blender/blender/pulls/135944
2025-03-14 04:48:41 +01:00
Harley Acheson
edf2706f8c UI: Improve Usage of Tooltips for Pen Users
Hovering over UI items will pop up a tooltip hint if you are perfectly
still. This is easy when using a mouse since it is resting on a
surface. But with a tablet pen you are holding it off the surface so
absolute stillness is difficult. This PR allow a small amount of
movement. So unsteady or slow movement will still pop up the hint.

Pull Request: https://projects.blender.org/blender/blender/pulls/135602
2025-03-13 23:35:40 +01:00
Harley Acheson
8c5393d4c0 Fix #94324: Longer Drag Threshold for Pens on Tool Icons
Toolbar items with variations open a menu on long press. But they will
also open immediately on drag. The amount of distance it considers a
drag is about two pixels. Tablet pen users generally move more than
that while selecting items so the menu almost always pops out. This PR
uses the correct drag distance per pointer type, and uses the position
of the start of the drag instead of the last reported position.

Pull Request: https://projects.blender.org/blender/blender/pulls/135677
2025-03-13 23:10:47 +01:00
Clément Foucault
4ba3b1985c Overlay: Avoid engine recreation for clipping region toggle
This changes the shader module reference to a pointer and
set it during `init()`
2025-03-13 22:06:56 +01:00
Guillermo Venegas
4245f1320e Fix #135742: Avoid unespecified font style for side panel categories text draw
Apply widget style to avoid drawing with the incorrect text size or
weight for side panel categories.

Pull Request: https://projects.blender.org/blender/blender/pulls/135824
2025-03-13 21:44:23 +01:00
Miguel Pozo
d7efed77b8 Merge branch 'blender-v4.4-release' 2025-03-13 19:59:10 +01:00
Miguel Pozo
08bd2d687d Fix #135848: Selection-Next: Backface culling (2)
Alternative fix for #135848.
Initially fixed by #135867, but broken again by #135917.

This performs the early return manually for the depth prepass.

Pull Request: https://projects.blender.org/blender/blender/pulls/135924
2025-03-13 19:26:15 +01:00
Bastien Montagne
36826f0237 BKE ID management: Add an overload of BKE_libblock_find_session_uid without idtype.
Allows to search for a session_uid in a whole Main, when the target ID
type is not known.
2025-03-13 19:03:12 +01:00
Clément Foucault
e5ae55af88 Cleanup: Overlay: Resolve warning about unused variable with C++ shader 2025-03-13 16:34:13 +01:00
Clément Foucault
9f97d19ebd Cleanup: DRW: Resolve warning about unused variable in release 2025-03-13 16:33:46 +01:00
Clément Foucault
dfb5be53cd Fix #135922: DRW: Blender crashes when saving a file
Was using the wrong viewport variable (that could be
nullptr) for the drawing.
2025-03-13 16:27:04 +01:00
Clément Foucault
cdacaa0a13 Fix: DRW: Warning about missing declaration in lite build 2025-03-13 16:27:04 +01:00
Jeroen Bakker
7857d9e3bf Fix: Vulkan: Std430 push constant packing
When using vec3[] as push constants it selected the incorrect
branch resulting in uploading incorrect data to the shader.

This resulted in not seeing the clipping bounds in vulkan.

Ref: #131111
2025-03-13 16:21:28 +01:00
Jeroen Bakker
330583961a Fix: Vulkan: Incorrect background blending
`GPU_BLEND_BACKGROUND` set incorrect blend mode, resulting
in incorrect rendering when activating bordered rendering.

Ref: #131111
2025-03-13 16:21:28 +01:00
Hans Goudey
70095e9041 Cleanup: DRW: Use data span to fill lattice line index buffer
Pull Request: https://projects.blender.org/blender/blender/pulls/135921
2025-03-13 16:19:18 +01:00
Hans Goudey
284ac406d6 Mesh: Avoid function call overhead when extracting UV lines indices
Similar to other changes from #116901.
2025-03-13 16:19:17 +01:00
Miguel Pozo
083878c46b Merge branch 'blender-v4.4-release' 2025-03-13 16:14:24 +01:00
Miguel Pozo
ce41fbaefa Revert "Fix #135848: Selection-Next: Backface culling"
This reverts commit
44b64ca9df.
The fix is broken by
04a57dd937.
2025-03-13 16:11:33 +01:00
Sean Kim
7ea75dccc2 Cleanup: Remove OBEDIT_FROM_OBACT usage in info_stats.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/135812
2025-03-13 15:59:15 +01:00
Clément Foucault
04a57dd937 Fix #135898: Selection: Make selection not depth aware
No depth awareness is wanted during object mode selection.
The hits are depth ordered in some selection mode but none
is supposed to reject based on depth.

Pull Request: https://projects.blender.org/blender/blender/pulls/135917
2025-03-13 15:16:05 +01:00
Jeroen Bakker
15d88e544a GPU: Storage buffer allocation alignment
Since the introduction of storage buffers in Blender, the calling
code has been responsible for ensuring the buffer meets allocation
requirements. All backends require the allocation size to be divisible
by 16 bytes. Until now, this was sufficient, but with GPU subdivision
changes, an external library must also adhere to these requirements.

For OpenSubdiv (OSD), some buffers are not 16-byte aligned, leading
to potential misallocation. Currently, this is mitigated by allocating
a few extra bytes, but this approach has the drawback of potentially
reading unintended bytes beyond the source buffer.

This PR adopts a similar approach to vertex buffers: the backend handles
extra byte allocation while ensuring data uploads and downloads function
correctly without requiring those additional bytes.

No changes were needed for Metal, as its allocation size is already
aligned to 256 bytes.

**Alternative solutions considered**:

- Copying the CPU buffer to a larger buffer when needed (performance impact).
- Modifying OSD buffers to allocate extra space (requires changes to an external library).
- Implementing GPU_storagebuf_update_sub.

Ref #135873

Pull Request: https://projects.blender.org/blender/blender/pulls/135716
2025-03-13 15:05:16 +01:00
Omar Emara
e9af802330 Refactor: Compositor: Use generic pointer with MF operation
This patch refactors how single values are passed to MF operations by
utilizing generic pointers. This avoids boilerplate and makes it easier
to add new types.
2025-03-13 15:47:46 +02:00
Miguel Pozo
44b64ca9df Fix #135848: Selection-Next: Backface culling
Allow extending the DRWState on select_bind so backface culling can be used when needed.

Note: There's still a difference in behavior with Overlay Legacy, causing backface culled flat objects to still be selectable at the edges, due to the "MeshFlat" workaround.
Pull Request: https://projects.blender.org/blender/blender/pulls/135867
2025-03-13 14:23:17 +01:00
Jesse Yurkovich
e492794e1e Fix: Resolve several int -> uint conversion shader warnings
Resolves several int -> uint conversion warnings. Warnings like the
following will be printed otherwise:

```
      |
  225 |   uint shadow_type = flags & 0xF;
      |                      ^
      | gpu_shader_text_vert.glsl:17:22: Warning: some implementations
        may not support implicit int -> uint conversions for `&'
        operators; consider casting explicitly for portability
```

Pull Request: https://projects.blender.org/blender/blender/pulls/135890
2025-03-13 14:22:21 +01:00
Clément Foucault
c02dea2e26 Fix: GL: Race condition in shader compilation
The patch strings did not have thread safe initialization.
The string might hav been returned null or incomplete
which might trigger compilation errors.
2025-03-13 14:04:59 +01:00
Omar Emara
9bf05f4def Refactor: Compositor: Provide const variants for data accessors
This patch provides const variants to the cpu_data accessors that
returns GSpan. This is done to better const correctness. Some code need
non-const data even for read-only data, so we have to const cast those
for the moment.
2025-03-13 14:49:01 +02:00
Clément Foucault
94c7c84bcd Refactor: DRW: Simplify the DRWContext classes and methods
This refactor part of `draw_manager_c.cc` to make it more understandable
and less bug prone.

- Splits the context handing to `draw_gpu_context.cc`
- Rename `draw_manager_c.cc` to `draw_context.cc`
- Merge `DRWContextState` into `DRWContext`
- Merge lots of static functions into `DRWContext` to avoid global access
- Deduplicate code between entry point functions
- Move context init logic to `DRWContext` constructor
- Move resource init logic to `DRWContext::acquire_data`
- Move extraction `TaskGraph` out of `DRWContext`
- Reduce / centralize complexity of enabling draw engines
- Reduce the amount of `drw_get` calls
- Remove unused code

Pull Request: https://projects.blender.org/blender/blender/pulls/135821
2025-03-13 13:47:02 +01:00