Commit Graph

118871 Commits

Author SHA1 Message Date
Brecht Van Lommel
7aaa43b557 Revert "Fix: Build failures when using path with spaces on macOS"
This reverts commit be63ebd961.

This doesn't work well with MSBuild, semicolons get escaped even in
verbatim mode.
2025-04-10 13:04:34 +02:00
Falk David
62062c7915 Fix #137227: Grease Pencil: Crash when getting multi frame falloff
One of the calls to get the frame falloff was missing a
check for `use_multi_frame_falloff`.

This puts the conditions for when the multi frame falloff
needs to be calculated in the `get_frame_falloff` function.
That fixes the crash and makes a code a bit easier to read
(without ternary operator).

Pull Request: https://projects.blender.org/blender/blender/pulls/137259
2025-04-10 12:21:52 +02:00
Julian Eisel
4f965e4d38 Fix #136254: Assets not available in search after saving file
We'd rather aggressively clear asset lists on file save since 9a9e2e19a9 (and
some related commits), seems like we can be a bit more precise here. Only
reload assets from the current file when saving the file, which is quite fast
to do and doesn't happen asynchronously (so UIs showing assets will only show
up once the assets are ready).

Actually we might not have to clear on file save at all, but needs more
testing.

Also fixes disappearing of asset previews on file save.

Pull Request: https://projects.blender.org/blender/blender/pulls/137117
2025-04-10 11:31:46 +02:00
YimingWu
79c6f2eacf Grease Pencil: Use smooth brush setting when smoothing temporarily
When sculpting a grease pencil object, user can hold `Shift` key to
temporarily switch to smooth brush. Previously it will keep using
whatever brush settings from the original brush for smoothing, which is
not ideal, now it will switch to the actual smooth brush but only keep
the radius the same.

The implementation is largely the same as `smooth_brush_toggle_on` from
`sculpt.cc`, brush is changed and restored in `on_stroke_begin/end`.

Part of #136300

Pull Request: https://projects.blender.org/blender/blender/pulls/136827
2025-04-10 11:28:34 +02:00
Jacques Lucke
dcc8d28859 Refactor: Geometry Nodes: store tree identifier in tree logger
The main goal here is to add `GeoTreeLogger.tree_orig_session_uid`. Previously,
it was always possible to derive this information in `ensure_node_warnings`.
However, with closures that's not possible in general anymore, because the
Evaluate Closure node does not know statically which node tree the closure zone
is from that it evaluates. Therefore, this information has to be logged as well.

This patch initializes `tree_orig_session_uid` the same way it initializes
`parent_node_id`, by scanning the compute context when creating the tree logger.
To make this work properly, some extra contextual data had to be stored in some
compute contexts.

This is just a refactor with no expected functional changes. Node warnings for
closures are still not properly logged, because that requires storing
source-location data in closures, which will be implemented separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/137208
2025-04-10 08:56:02 +02:00
Jeroen Bakker
a564a27c1f Cleanup: OpenXR: Introduce a Direct3D base class.
For the Vulkan/OpenXR code will be shared with the OpenGL-Direct3D
bridge. This cleanup separates the OpenGL specifics in its own class.

Pull Request: https://projects.blender.org/blender/blender/pulls/137252
2025-04-10 08:50:52 +02:00
Campbell Barton
39db404ba4 Fix: resetting/clearing the filename skipped validation
The logic to add a file extension to the filename - which runs when
editing the text was not running when resetting/clearing the value.

Resolve by calling `uiBut::func`.

Along with [0], this fixes #134101.

[0]: f2a1c8d77c
2025-04-10 04:20:53 +00:00
Sean Kim
98fa6927d8 Cleanup: Various non-functional changes to paint cursor drawing methods
* Uses C++ math functions and types where possible
* Uses const where possible
* Reduces scope of variables where possible

Pull Request: https://projects.blender.org/blender/blender/pulls/137239
2025-04-10 05:39:34 +02:00
Sean Kim
7a4052e561 Cleanup: Reorganize rna_brush.cc capability section
* Groups related capabilities together
* Also adds a missing undef

Pull Request: https://projects.blender.org/blender/blender/pulls/137241
2025-04-10 05:39:06 +02:00
Campbell Barton
b2dbfa7d77 Cleanup: spelling in comments, use doxygen comments 2025-04-10 13:02:29 +10:00
Harley Acheson
2f6a10c75e Fix #137186: Allow Event Handling When Cursor Outside Wide Menus
When a wide menu is open and you move your mouse outside of it we have
new code that prevents the immediate opening of neighboring menus. But
while in this condition of mouse outside the menu, the rest of the
event processing is not run, so pressing "escape" will not close it.
This PR just moves the conditions around so event handling always
continues unless another menu is opened.

Pull Request: https://projects.blender.org/blender/blender/pulls/137243
2025-04-10 04:06:21 +02:00
Campbell Barton
94aabc0dbe Versioning: ensure render slot names are valid UTF8
Also include pixel density which missed a version bump.
2025-04-10 01:47:11 +00:00
Campbell Barton
c70b48aae2 Fix: new render slots could contain truncated UTF8 byte sequences
Creating render slots from Python could truncate multi-byte sequences
which would then raise an exception when accessed.
2025-04-10 11:41:49 +10:00
Campbell Barton
4bd7706099 Fix: error report writing image that displayed "Success"
Failure to write an image that didn't set `errno` reported:

"Could not write image: Success"

Check errno is non-zero before using it's message,
ideally error prints would be shown here.
2025-04-10 01:01:35 +00:00
Campbell Barton
24f8819c78 Fix: correct check for Iris image dimensions
Mistake in [0], missed width check.

[0]: 7a23d7aba4
2025-04-10 10:50:10 +10:00
Sean Kim
4a97a807e5 Cleanup: Various non-functional changes to PaintCursorContext struct
* Use C++ math container types instead of arrays
* Use enum class instead of enum
* Use references instead of pointer for PainCursorContext
* Add a few comments

Pull Request: https://projects.blender.org/blender/blender/pulls/137235
2025-04-10 00:47:35 +02:00
Sean Kim
5a5db5ea88 WM: Pass tablet tilt data to paint cursor draw callback
Part of #82877

When drawing specialized cursors for the different paint modes via the
`wmPaintCursor` draw callback, tablet tilt direction is unavailable to
use to customize the drawing for the user.

To enable this functionality, this commit adds the `x_tilt` and `y_tilt`
data read while processing MOUSEMOVE events to the `eventstate` variable
so it can be used by consuming functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/137189
2025-04-09 23:07:03 +02:00
Jesse Yurkovich
7afcba7da6 Cleanup: Movie: Adjust DNA and comments from recent ProRes addition
A few tidy ups from the recent ProRes addition[1]
- Reduce size of DNA structs
- Follow coding guidelines for multi-line comments

[1] 7d75c5e2bc

Pull Request: https://projects.blender.org/blender/blender/pulls/137231
2025-04-09 21:41:29 +02:00
Clément Foucault
890e00cecb DRW: DebugDraw: Revamp the module and make it global
- Make the module global and allow usage from anywhere.
- Remove the matrix API for thread safety reason
- Add lifetime management
- Make display linked to the overlays for easy toggling

## Notes
- Lifetime is in redraw. If there is 4 viewport redrawing, the lifetime decrement by 4 for each window redraw. This allows one viewport to be producer and another one being the consumer.
- Display happens at the start of overlays. Any added visuals inside of the overlays drawing functions will be displayed the next redraw.
- Redraw is not given to happen. It is only given if there is some scene / render update which tags the viewport to redraw.
- Persistent lines are not reset on file load.

Rel #137006

Pull Request: https://projects.blender.org/blender/blender/pulls/137106
2025-04-09 21:37:23 +02:00
Miguel Pozo
712e35a627 Cleanup: Don't use atomic aliases 2025-04-09 20:05:29 +02:00
Bastien Montagne
bb39cfc4ee Fix compiling Blender with USD in clang19.
Some headers are missing again it'd seem...

Pull Request: https://projects.blender.org/blender/blender/pulls/137212
2025-04-09 19:07:36 +02:00
Pablo Vazquez
3e8801849f UI: Make auto-run scripts setting off by default
Even though the default startup already has `Trusted Source` and
`Auto Run Python Scripts` off by default, when resetting their values
to default (right click, Reset to Default) they would be turned on.

It was simply missing explicitly setting this off by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/137205
2025-04-09 18:57:13 +02:00
Hans Goudey
63beb6afb3 Fix #137145: Crash when enabling Auto Normalize in Weight Paint mode
Caused by d3f84449ad.

The problem was that one SharedCache referenced the data of another,
without using the shared_ptr mechanism that is typically used for that
case. I had forgotten to avoid this-- I already did a similar fix a couple
years ago for curves: b07085fe3c

This time I kept the result as part of the cache to avoid the overhead
of attribute access on every call to `Mesh::face_normals()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137167
2025-04-09 17:57:12 +02:00
Habib Gahbiche
93f0867ba6 Cleanup: use dedicated math function for comparison with zero
Pull Request: https://projects.blender.org/blender/blender/pulls/137221
2025-04-09 17:20:18 +02:00
Miguel Pozo
176865062a Draw: Skip empty passes
Allow detecting passes that can be skipped without side-effects and
don't submit them.
Eases debugging and profiling, and may provide a performance
improvement.

Pull Request: https://projects.blender.org/blender/blender/pulls/135875
2025-04-09 15:34:38 +02:00
Habib Gahbiche
74818141a5 Fix: Assert division by zero when ellipse mask size is zero
`BLI_assert(b[i] != T(0));` assert in `VecBase operator/(const VecBase &a, const VecBase &b)`. Not an issue in release mode because the result of `math::length(x/0)` evaluates to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/137203
2025-04-09 14:55:26 +02:00
Falk David
58fa6a50ce Fix #137152: Grease Pencil: Layer flag is overridden during conversion
Broken by 4c9c9af2d6.

When Grease Pencil objects get converted (<= 4.2 to >= 4.3)
the code copies the legacy color over to the new one.
The issue is that the new color is a `float[3]` not a
`float[4]`! Thus the `flag` after the `color` was getting
overridden.

This fixes the issue by replacing the `copy_v4_v4` with a
`copy_v3_v3`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137161
2025-04-09 13:38:21 +02:00
Habib Gahbiche
f77245e523 Clneaup: Node gizmos: check nullptr before flag access
Pull Request: https://projects.blender.org/blender/blender/pulls/137204
2025-04-09 13:32:56 +02:00
Campbell Barton
82a37e143f Fix #136563: Crash clicking on a light after it has been deleted
Failure to refresh the highlighted gizmo meant that clicking
on a highlighted gizmo would attempt to activate it even though
it's poll function failed - which crashed in this case.

Resolve the common-case by ensuring a call to refresh the gizmo-map
causes the event system to re-evaluate the highlighted gizmo,
even if the cursor doesn't move.

Since it's still possible the call to "refresh" the gizmo is missed,
gizmo_tweak_invoke now checks the gizmo-groups poll succeeds with an
assert and early return if it doesn't. This would have prevented the
crash although the highlighted-gizmo still won't be reset - causing
the cursor to display as if it's over a gizmo until it's moved.
2025-04-09 11:21:55 +00:00
Pratik Borhade
ff85c97278 Fix: Grease Pencil stats in status bar when in edit mode
When in edit mode, wrong stats info is shown for grease pencil. Move the
GP condition above so it is processed before `OB_MODE_EDIT`

Pull Request: https://projects.blender.org/blender/blender/pulls/137194
2025-04-09 11:46:12 +02:00
Jacques Lucke
8674ac339b Cleanup: avoid verbose redundant type names 2025-04-09 11:20:24 +02:00
Campbell Barton
12f0164eb0 CMake: match defines & CMake variable names
Avoid mistakes with these variables getting mixed up
(see: bf03a2684b).

Ref !137183
2025-04-09 08:44:36 +00:00
Jacques Lucke
8f52d535ac Refactor: Geometry Nodes: improve accessing contextual tree log data
The original motivation for this was to prepare the API to support having more
than one tree log for each zone. Currently, there is always a well defined tree
log for each zone (when the inspection index is taken into account). However,
for closures that is less true and there may be more than one equaly valid tree
log. While we might still want to show only one value per socket initially, it
would probably be nice in the future to support accessing information from
multiple evaluations at the same time (also for loops).

None of this is implemented here though, it's just a refactor with no expected
functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/137166
2025-04-09 09:53:48 +02:00
David Murmann
73efe738e4 Fix #135696: Alembic: Interpolate curve control points
Reading curves from alembic files did not interpolate the curves between
frames, leading to incorrect motion blur. This uses the existing
`use_vertex_interpolation` flag on the MeshSequenceCache to enable the
subframe interpolation.

Pull Request: https://projects.blender.org/blender/blender/pulls/135698
2025-04-09 06:50:25 +02:00
Harley Acheson
840f6f2e4c UI: FullScreen Remove Outline and Fix One Pixel Offset
When toggling area "Fullscreen" with Ctrl-Spacebar, there is a one
pixel vertical change in the top of the area. This fixes that,
removes the border and active area outline. Looks much nicer.

Pull Request: https://projects.blender.org/blender/blender/pulls/137184
2025-04-09 04:44:37 +02:00
Campbell Barton
b024fe041e Cleanup: use more descriptive names for the IRIS format
Also add some code-comments.
2025-04-09 01:47:02 +00:00
Campbell Barton
6d8d37558a Cleanup: replace outdated function names in __func__ in error messages 2025-04-09 11:32:21 +10:00
Campbell Barton
7a23d7aba4 Fix: error writing & loading corrupt IRIS files
- Files cannot exceed 65535 width or height,
  attempting to write 65536 would write a zero sized image.
- Ensure that zero sized imbufs are never loaded.
2025-04-09 11:28:58 +10:00
Campbell Barton
35f5877ac3 Fix: incorrect iris image header detection
The first two bytes were being checked in the wrong order,
if files using this header were loaded they would detect as IRIS files
from imb_is_a_iris which would then fail to load (printing errors).
2025-04-09 11:05:47 +10:00
Campbell Barton
e94068e8d2 PyAPI: add "image_webp" build option
Match other image_* format booleans.
2025-04-09 10:26:55 +10:00
Campbell Barton
bf03a2684b Fix: error with CMake checking the wrong WEBP variable 2025-04-09 10:21:37 +10:00
Campbell Barton
2dc4a94e8b Cleanup: use consistent "format_" prefix for imbuf image formats 2025-04-09 00:16:20 +00:00
Campbell Barton
24dd6dd23e Cleanup: quiet warnings with headless builds 2025-04-09 09:55:26 +10:00
Harley Acheson
166d45b80f UI: Padding When Opening Menu When One is Already Open
When you open a menu or popover, moving your mouse to a neighboring
root menu button will switch to that one. For example when you open the
"File" menu and move to the right to have "Edit" open automatically.
This currently causes problems with some neighboring menus. This PR
adds a safety padding to the open item. This generally means that once
you open a menu, you will need to move your mouse into the neighbor's
content, not just hit the edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/135692
2025-04-08 22:45:39 +02:00
Sean Kim
a0eedd2193 Fix: Multiplane Scrape sculpt plane can be incorrect
Similar to !136965

Pull Request: https://projects.blender.org/blender/blender/pulls/137015
2025-04-08 22:36:06 +02:00
Harley Acheson
110b8fee41 UI: Do Not Open Neighboring Menu if Open One is Wide
When a menu is open, moving your mouse to a neighboring menu can cause
that menu to open, closing the open one.  This is very problematic when
the open menu is very wide because users are likely to travel over
other menus while moving toward items in far columns. Typically this is
the "change area" menu, but this can happen with any wide menu. This PR
just checks the menu width and turns off this feature when it is wide.

Pull Request: https://projects.blender.org/blender/blender/pulls/136528
2025-04-08 22:01:40 +02:00
Harley Acheson
b4194b08d4 UI: Do Not Full Hide Scroll Bars When Region Overlap
Currently scroll bars that are in regions that are set to "region
overlap" (like Tool Bar and Side Bar using a transparent background)
will fully hide when your mouse is not near them. This PR removes that
feature so that they are treated like in other areas. This way you can
always see that there are portions of the region scrolled away and what
proportion. A less jarring transition since it is only 0.4 - 1.0,
rather than 0.0 - 1.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/136571
2025-04-08 21:32:43 +02:00
Harley Acheson
b847cc0426 UI: Region Scaling Edge Highlighting
This draws a highlight line on the active edge of regions, like side
bars and toolbars, while dragging to resize them. Similar as we do for
area resizing. This has marginal utility while using a mouse, but is
much more important when using a pen. More so when the pen has a
minimum pressure for clicking. Even more so when using touch as your
finger covers the hit target.

Pull Request: https://projects.blender.org/blender/blender/pulls/136337
2025-04-08 21:12:40 +02:00
Jacques Lucke
93deafd4a3 Refactor: Depsgraph: add const variants of a couple depsgraph query functions
This avoids the need for `const_cast` when using the depsgraph query functions
like `DEG_get_original_id` in many cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/137162
2025-04-08 18:55:22 +02:00
Richard Antalik
bf18e8f814 UI: Filter visible tabs in Properties Editor
This commit allows to specialize or optimize properties editor for
particular workflows by hiding individual tabs. The filtering is done on
editor level, currently in editor options popover panel.

Primary motivation was to allow strip properties to be moved to
properties editor. The filtering is beneficial, as usually it does not
make sense to show strip propeties in modelling workspace and in video
editing workspace other properties would introduce quite a bit of noise.

Ref. #115626

Pull Request: https://projects.blender.org/blender/blender/pulls/115624
2025-04-08 18:43:18 +02:00