Commit Graph

148992 Commits

Author SHA1 Message Date
John Kiril Swenson
7d9499bdc4 VSE: Keep zoom levels constant when resizing
We can apply the `V2D_KEEPZOOM` and `V2D_KEEPOFS_Y` flags to the main VSE
region to make sure this happens. If `V2D_KEEPZOOM` is set, we should update
the view2d's `oldwinx` and `oldwiny` in `ui_view2d_curRect_validate_resize`
just like the `V2D_KEEPASPECT` case.

Divide-by-zero is a real possibility here, since initialization status of
`oldwinx/y` cannot be determined from the `resize` boolean alone (e.g. loading
regions from disk on startup yields a `true` `resize` parameter, so any old
regions that have `KEEPZOOM` added through versioning will get this error since
their `oldwinx/y` is uninitialized). Avoid by initializing `oldwinx/y` if it is zero in
`ui_view2d_curRect_validate_resize`.

Addresses #136508.

Pull Request: https://projects.blender.org/blender/blender/pulls/137802
2025-04-23 03:04:55 +02:00
Loïc 'Lauloque' Dautry
38a58a319d UI: Viewport Shading Modes Tooltips More Descriptive
Viewport shading mode descriptions improved.  "Display only edges of
geometry without surface shading", "Display objects with flat lighting
and basic surface shading", "Preview materials using predefined
environment lights" and "Preview the final scene using the active
render engine".

Pull Request: https://projects.blender.org/blender/blender/pulls/137699
2025-04-22 23:44:41 +02:00
Laurynas Duburas
1d815fdcb8 Cleanup: Remove unused curves NURBS variable 2025-04-22 17:08:45 -04:00
Harley Acheson
e9cc07a24c UI: Changes to Save Startup Dialog
Simplification of the text on the "Save Startup" Confirmation dialog,
trying to reduce jargon and instead focus on the user effect. Title
of "Overwrite Startup File" and body of "Blender will start next time
as it is now." Similar wording for template startups.

Pull Request: https://projects.blender.org/blender/blender/pulls/134429
2025-04-22 23:02:16 +02:00
Sean Kim
d8bab1a65e Fix #137751: Dyntopo undo can crash when drawing attributes
When performing an undo in Sculpt Mode with Dyntopo enabled, it is
possible that the active color attribute exists in the original mesh but
not on the BMesh used by Dyntopo. When attempting to extract this color
data, this can then lead to a crash.

To prevent this, use the BMesh as the source of truth for existence of
generic attributes when mode inside Sculpt Mode when Dyntopo is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/137828
2025-04-22 22:24:10 +02:00
Guillermo Venegas
7002f16992 Refactor: UI: Split uiLayout API into separate header
Move most `uiLayout` and `uiItem` functions to a separate
`UI_interface_layout.hh` header file. `uiItem` and `uiLayout` structs
are moved from `interface_layout.cc` to `UI_interface_Layout.hh` in
preparation for switching to an object oriented API style.

`UI_block_layout*` functions are moved to `UI_interface_Layout.hh` too,
since their implementation is also in `interface_layout.cc`

Types shared by `UI_interface_Layout.hh` and `UI_interface_c.hh`
are moved to `UI_interface_types.hh`.

Ref: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/136717
2025-04-22 22:14:57 +02:00
Pratik Borhade
7f25d1c9d0 Fix #137784: Translate text in status bar when interface translate is on
"Options" text of cursor being translated when tooltip translation is
enabled. Now fixed by replacing with `IFACE_`

Pull Request: https://projects.blender.org/blender/blender/pulls/137801
2025-04-22 22:04:55 +02:00
Nicola
e2b9839aea Sculpt: Clay Strips optimizations
This patch introduces some optimizations to Clay Strips, resulting in a
speedup of approximately 1.22x.

- The translations are calculated more efficiently using the local
  space, similar to the approach used for the Plane brush.
- Plane trimming is computed in local space.
- Strength is applied to the offset vector, avoiding an extra per-vertex
  multiplication.
- The local space is constructed such that vertices affected by
  the brush have a positive z-coordinate.

Note: this patch doesn't alter the way the brush works. Any
difference should be considered a bug.

Pull Request: https://projects.blender.org/blender/blender/pulls/137558
2025-04-22 20:49:05 +02:00
Jesse Yurkovich
bc0a9d31e5 Cleanup: USD: Various non-functional cleanups to usd_reader_material
Changes
- `Main` and `NodePlacementContext` are never-null, so use references
  where possible for these types.
- Move the node placement and node caching logic inside the
  NodePlacementContext class itself.
- Remove effectively dead code which checked return value of
  `node_add_static_node` for built-in node types.

Pull Request: https://projects.blender.org/blender/blender/pulls/137797
2025-04-22 20:24:23 +02:00
Miguel Pozo
8b60a65466 Fix #137566: EEVEE: Crash when zooming Blended object in Ortho mode
Use nextafter to prevent infinite loops.

Pull Request: https://projects.blender.org/blender/blender/pulls/137859
2025-04-22 18:49:18 +02:00
Habib Gahbiche
ce5fe6e017 Cleanup: Use Assert in tests to avoid crashes when tests fail
Pull Request: https://projects.blender.org/blender/blender/pulls/137857
2025-04-22 17:59:26 +02:00
Ramon Klauck
12f5ce7c85 VSE: Make mirror operator work in VSE preview
By default, the Ctrl-M shortcut is not working in the VSE preview.

This PR aims to address the issue and provide a working iteration of
the feature.

In my view, it would be preferable for this operator to not only flip
the `flip_x` and `flip_y` values, but also manipulate the transform and
rotation of the strips in a way that keeps the strip in the same
location on the screen, rather than flipping them to the other side.

I decided to implement the feature with this correction functionality,
as it seems more coherent with how the mirror works in other areas of
Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/136343
2025-04-22 17:28:29 +02:00
Sybren A. Stüvel
b59b4d87a8 Fix #137779: Assigning Action without slot can crash the Dope Sheet
Normally, the dope sheet will not show the directly-assigned Action,
when that Action has no animation data for the data-block.

However, when that data-block uses the NLA, and one or more NLA strips
have an animated property (like their influence), the Action is shown in
the dope sheet for some reason.

This caused the "draw the summary line for this Action" to fail, because
it assumes there must be a slot (because normally when it's drawn, it
implies there is animation data, and thus a slot).

This assumption has been fixed, and the "no slot" case is now handled
properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/137844
2025-04-22 16:47:14 +02:00
Omar Emara
8bb1ebb5f7 Compositor: Turn Keying Screen options to inputs
This patch turns the options of the Keying Screen node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137851
2025-04-22 15:57:46 +02:00
Hans Goudey
685894b665 Cleanup: Use Span argument for KeyBlock conversion function 2025-04-22 09:39:52 -04:00
Miguel Pozo
4e13fd4712 Fix #137560: Overlay: Mesh visibility mismatch
Skip prepass if depth is available.

Pull Request: https://projects.blender.org/blender/blender/pulls/137826
2025-04-22 15:09:14 +02:00
Miguel Pozo
f933282ed5 Fix #137514: EEVEE: Holdout objects still emit radiance
Disable radiance for holdout objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/137824
2025-04-22 15:07:02 +02:00
Habib Gahbiche
49c284fe87 UI: Compositor: Activate viewer node when icon is clicked
Currently, clicking on the viewer icon in the compositor has no effect,
whereas in geometry nodes it activate or deactivates the viewer.

The compositor requires exactly one viewer to be active. So pressing the
icon when the viewer is already active has no effect

Pull Request: https://projects.blender.org/blender/blender/pulls/137840
2025-04-22 14:56:21 +02:00
Omar Emara
730cb40f4c Compositor: Turn Color Spill options to inputs
This patch turns the options of the Color Spill node into inputs.

In the process, the Ratio option was renamed to Limit Strength, the
unspill option was renamed to Spill Strength.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137848
2025-04-22 14:51:26 +02:00
Thomas Dinges
8706390dd8 License: Regenerate licence doc 2025-04-22 14:35:37 +02:00
Thomas Dinges
77022c7f28 Fix: License document had wrong link for public domain
Pull Request: https://projects.blender.org/blender/blender/pulls/137841
2025-04-22 14:34:51 +02:00
Brecht Van Lommel
50023eab75 Fix: Invalid kdtree node allocation after recent refactor
Address the root cause and fix one definition rule violation.
Broken by fb2ba20b67.

Pull Request: https://projects.blender.org/blender/blender/pulls/137845
2025-04-22 14:32:39 +02:00
Alaska
92b748a91b Fix: Cycles adaptive kernel compilation
This commit fixes a issue where Cycles adaptive kernel compilation
would always undefine adaptive kernel features, resulting in various
issues like incorrect renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/137804
2025-04-22 13:26:28 +02:00
Campbell Barton
9de0aa1066 Fix: #133486: 'use_region_toggle_pie' AssertionError in MovieClipEditor 2025-04-22 11:25:14 +00:00
Campbell Barton
3c15f1bbe0 Cleanup: quiet Python linter warnings 2025-04-22 21:23:03 +10:00
Philipp Oeser
b40760caf8 Fix #137610: Motion Paths don't auto-update
Caused by 43d7558e5b

So for new layered actions, we need to get the list of FCurves in a
different way (via Channelbag).

Pull Request: https://projects.blender.org/blender/blender/pulls/137653
2025-04-22 12:30:42 +02:00
Colin Marmond
95659c0bfb Shader: Use experimental node previews only for material trees
Restrict the node previews to only material node-trees which are the only
supported for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/137836
2025-04-22 11:28:25 +02:00
Brecht Van Lommel
fb2ba20b67 Refactor: Use more typed MEM_calloc<> and MEM_malloc<>
Pull Request: https://projects.blender.org/blender/blender/pulls/137822
2025-04-22 11:22:18 +02:00
Pratik Borhade
bf7c53bd57 Fix #137825: Grease Pencil: Orbit around selection fails in paint mode
Wrong origin was calculated when inside paint mode. Use
`BKE_paint_stroke_get_average` for correct pivot point in grease pencil
modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137831
2025-04-22 11:20:52 +02:00
Nathan Vegdahl
b69a4380b6 Fix: non-trivial memcpy compiler warnings on animrig copy constructors
The copy constructors for `animrig::Strip`, `animrig::Slot`, and
`animrig::StripKeyframeData` used a `memcpy` call as part of the copy
implementation. However, this produced warnings on clang 20.  For example:

```
warning: first argument in call to 'memcpy' is a pointer to
non-trivially copyable type 'blender::animrig::Strip'
[-Wnontrivial-memcall]`
```

These warnings did not reflect any actual bugs, because the underlying DNA
structs that those types wrap are in fact trivial. Nevertheless, it's worth
fixing the warnings.

This fixes the warnings by replacing the uses of `memcpy` with equivalents that
amount to a `memcpy` anyway, but which the compiler understands are valid for
the types.

There was also one additional use of `memcpy` in `Strip::create()` that did not
trigger a warning because it operated directly on the underlying DNA struct, but
was also unnecessary. This PR also replaces that with a simple assignment.

Pull Request: https://projects.blender.org/blender/blender/pulls/137467
2025-04-22 10:42:20 +02:00
Christoph Lendenfeld
145af8d45b Refactor: Add function to query editable Graph Editor curves
No functional changes intended.

This patch extracts functionality to get all `bAnimListElem`
that are editable in the Graph Editor
into a separate function so it can be re-used by other operators.
This makes it easy to ensure the same data is retrieved and
filter flags can't go out of sync.

Extracted from #135913
Part of: #135794

Pull Request: https://projects.blender.org/blender/blender/pulls/137142
2025-04-22 10:28:39 +02:00
Alaska
6faef7b149 Fix #137647: Remove warning about macOS not supporting custom wire widths
In a previous commmit (1), custom wire width for armatures was disabled
on macOS and a corrisponding warning was added to the UI due to a
limitation at the time leading to rendering artifacts #124691.

These limiations appear to have been sorted in Blender 4.4 and so
custom wire widths now work on macOS. So this commit removes the
warning message form the UI.

(1) a451971026

Pull Request: https://projects.blender.org/blender/blender/pulls/137651
2025-04-22 09:50:57 +02:00
Campbell Barton
2196d365f2 Cleanup: various non functional changes 2025-04-22 17:36:20 +10:00
Campbell Barton
4935672317 Cleanup: replace inline check with BLI_path_is_rel 2025-04-22 17:30:54 +10:00
Omar Emara
5e93b6a2cd Compositor: Turn Luminance Key options to inputs
This patch turns the options of the Luminance Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137823
2025-04-22 09:09:51 +02:00
Mukhesh
541e2b3cdd VSE: Hide-Reveal strips operator in sequencer preview
This pull request adds options to hide and show strips in the Sequencer
Preview, using the same shortcuts. Included "Show/Hide" operators in the Strips
menu of preview mode. It only works on strips that are visible in the preview
at the current frame. The Unmute operator now shows all hidden strips in
the preview at the current  frame, since it's not possible to select hidden strips
in sequencer preview.

See video in PR description.

Pull Request: https://projects.blender.org/blender/blender/pulls/137781
2025-04-22 08:18:21 +02:00
Campbell Barton
720b00ae50 Cleanup: use doxygen comments in BKE, consistent comment blocks
Also remove doxygen comment use for comments in the functions body.
2025-04-22 06:13:33 +00:00
Campbell Barton
2372167e96 Fix: building WITH_TBB=OFF
Caused by 388a21e260
2025-04-22 06:13:31 +00:00
YimingWu
dd91ba6d0e Fix (unreported): Opening N panel with mouse frees null ptr
Just guard the `nullptr`` inside `actionzone_exit` fixes the issue.
2025-04-22 13:38:37 +08:00
Alaska
d2704076b7 Tests: Small adjustments to the principled_bsdf_bevel_emission test
This commit makes two small adjustments to the
principled_bsdf_bevel_emission test:
- The IOR on the material that has the bevel shader was increased.
  - With this change, RDNA4 GPUs in Blender 4.4.X now fail this test.
- The exr environment texture is swapped for a noise texture.
  - This reduces the file size by about 200kb.

Ref: blender/blender-test-data!87
2025-04-22 06:26:18 +02:00
John Kinzel
3356db0588 Fix: Interactive Add Tool does not restore the snap properties on cancel
When snap setting is set to default and operation is cancelled,
snap setting from the topbar changes to different value instead of retaining
previous choice.

Pull Request: https://projects.blender.org/blender/blender/pulls/137819
2025-04-22 05:52:20 +02:00
Omar Emara
d791ea7cc2 Compositor: Turn Distance Key options to inputs
This patch turns the options of the Distance Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137817
2025-04-21 19:28:57 +02:00
Brecht Van Lommel
d0477ffe2d Fix: Incorrect use of StringRef in USD logging
From refactor in b6372b3af3
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
d061b00455 Refactor: Eliminate various unsafe memcpy and memset
Some of these already have warnings with clang-tidy, others are more
safe in case these structs get (copy) constructors in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
388a21e260 Refactor: Eliminate various void pointers passed to MEM_freeN
It's safer to pass a type so that it can be checked if delete should be
used instead. Also changes a few void pointer casts to const_cast so that
if the data becomes typed it's an error.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
637c6497e9 Refactor: Use more typed MEM_calloc<>, avoid unnecessary size_t cast
Handle some cases that were missed in previous refactor. And eliminate
unnecessary size_t casts as these could hide issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
cf5fc4dcec Fix: Mismatched new/delete in annotation and text operators
Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Omar Emara
3c9f33ad07 Compositor: Turn Difference Key options to inputs
This patch turns the options of the Color Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137816
2025-04-21 17:59:24 +02:00
Omar Emara
615e7f079a Compositor: Use a more conservative execution preset
Use a SomeSpanOrSingle execution preset for recently adjusted nodes to
reduce binary size.
2025-04-21 17:15:08 +02:00
Omar Emara
fa7d58ab4c Compositor: Turn Color Key options to inputs
This patch turns the options of the Color Key node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137815
2025-04-21 16:40:17 +02:00