Commit Graph

118634 Commits

Author SHA1 Message Date
Sybren A. Stüvel
853640c063 Cleanup: clarify comment & variable in BKE_blender_cli_command_exec()
Just a little clarification. No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/136776
2025-04-01 16:30:01 +02:00
Clément Foucault
4b2cbf5d6f Fix #136810: UV: Wrong UV channel used for displaying UV edges
This was caused by the deinterleaved format being
incorrectly decoded by the `bind_attribute_as_ssbo`
function.

Accumulating the offset should be done for all attributes
and not only the one being used. Furthermore, this needs
to happen only once per attribute and not once per name.

Moving the offset computation out of the name loop
fixes the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/136821
2025-04-01 16:16:20 +02:00
Philipp Oeser
f13bf270c6 Fix #136479: missing Image preview icons for certain render engines
If render engines dont specify `RE_USE_PREVIEW` / `bl_use_preview`, they
wont pass the `ED_check_engine_supports_preview` test.
That is mostly meant to tell blender this engine is capable of
generating (Material) previews and if it isnt, they will skip generating
button previews in `icon_preview_startjob_all_sizes`.

There are already exceptions for type of IDs that can still generate
previews (think Asset previews for Objects or Actions), so the same
exception can be made for Images and Brushes  as well (these previews
will just befulled from the Image buffer, that should not rely on the engine
whatsoever). We can also be permissive on Groups (they are treated
similar to Objects).

NOTE: this was reported for the Workbench engine, in another (future)
commit, we might even consider flagging that engine `RE_USE_PREVIEW` as
well (see comments in the PR)?

Pull Request: https://projects.blender.org/blender/blender/pulls/136824
2025-04-01 16:06:22 +02:00
Jeroen Bakker
aed9f22233 Refactor: Vulkan: swapchain
This PR refactors the way how swapchains are used.

Allow scaling of the swapchain content to the actual resolution of the swapchain.
can reduce artefacts when resizing windows when supported.

When frame rate is to fast the previous implementation could use a semaphore
that were still in use, leading to unwanted stuttering on certain platforms. Waiting
when the rendering has finished (GHOST_Frame.submission_fence), before the
next image is acquired from the swap chain.

Mailbox has been disabled as it can calculate more frames then actually been
presented, leading to a lag and increased  power usage on others.

Pull Request: https://projects.blender.org/blender/blender/pulls/136603
2025-04-01 16:01:22 +02:00
Jeroen Bakker
b3c4190cf7 Fix #134928: Vulkan: Out of bounds framebuffer region
When making a minimized window larger Blender can have negative regions.
This leads to out of bound writes when blitting to the framebuffer.

Easy reproducable on NVIDIA/Windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/136832
2025-04-01 15:06:13 +02:00
Jacques Lucke
46fc5cb2cf Python: flush stdout and stderr after running Python script
When debugging with gdb in vscode, the stuff I print when executing a script in
the text editor does not show up in the terminal. It does work when I flush
explicitly though using `print(..., flush=True)`. This is quite annoying.

The solution is to always flush `stdout` and `stderr` automatically when running
a script. This is done using the CPython API, as just using
`fflush(stdout/stderr)` did not solve the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/136632
2025-04-01 12:41:38 +02:00
Pratik Borhade
e6b89924a0 Fix: UI: Remove tree view padding on right
Extra padding is visible on right when scroll bar button is not
required. To fix this, add the new column along with scroll bar button.

Pull Request: https://projects.blender.org/blender/blender/pulls/136746
2025-04-01 12:27:48 +02:00
Campbell Barton
d60bbbbe63 Fix #136280: Select shortest path crashes in the UV editor 2025-04-01 21:16:08 +11:00
Philipp Oeser
92c777576c Fix #136312: Grease Pencil: SVG export wrong resolution in camera view
Also affected PDF export.

From 4.3 onwards, we were always exporting with a rect representing the
camera in screespace (just as drawn on the screen).
In 4.2, this was remapped to the camera resolution specified in the
Output Properties.
This also affected pixel aspect being ignored in 4.3.

To resolve, get both the render resolution and the camera rectangle in
screenspace and remap them accodingly.

Behavior when not in camera wasnt changed (this was the same in 4.3 and
4.2 in that it would take the framing rect of the object(s) in the
viewport as document size.

NOTE: this was already reported in #134309 (which ended up being closed
by a fix that wasnt really fixing the issue originally reported I think)

Pull Request: https://projects.blender.org/blender/blender/pulls/136770
2025-04-01 11:54:49 +02:00
Philipp Oeser
e348b46307 Fix #136784: Missing default for "wireframe_color_type" in a new window
Was missing a default since its implementation in 1f4c7a36df

Now added as a DNA default.

Pull Request: https://projects.blender.org/blender/blender/pulls/136813
2025-04-01 11:53:51 +02:00
Jörg Müller
57117497fe Audaspace: Synchronizer API change
Removes the playback handle from the synchronizer API and integrates it
into the device, removing the ISynchronizer interface completely.

This has been discussed in more detail in #126047 and its main purpose is to unify the handling of synchronizer events, especially seek which needed different logic for jack vs other backends.

OpenAL now needs a silence playback handle for synchronization but all
other backends are pretty straightforward just counting the mixed
samples in the SoftwareDevice with some specializations for specific
backends that had their own synchronizers before.

Note: CoreAudio changes are untested as I don't have a Mac.

Pull Request: https://projects.blender.org/blender/blender/pulls/133191
2025-04-01 11:28:08 +02:00
Campbell Barton
c8ff5f5c42 Cleanup: clarify naming for snap_selected_to_location_rotation
- Now snapping supports both location & rotation, rename variables and
  arguments to clarify which they apply to.
- Remove references to in variable names "cursor",
  a hangover from when this has hard-coded to use the 3D cursor.

Also use blender::float3 in more places.
2025-04-01 14:31:47 +11:00
Padraig O Cinneide
c8ab27c573 Modeling: "Snap to Cursor" now supports "Rotation"
Adds an operator setting to allow matching the rotation of the snapped
object to the rotation of the 3d cursor.

When the operators "Rotation" option is enabled, it will rotate selected
objects to match the current rotation of the 3d cursor.
Rotation modes and axis locking are respected.

If multiple objects are selected, they will all be set to the rotation
of the 3d cursor. There's an opportunity for future work on this for
the case where "offset" is toggled on as well, so that the location and
rotation of offset objects would be determined by rotating around the
pivot point.

Addresses #134863.

Ref: !134963
2025-04-01 14:04:27 +11:00
Richard Antalik
2f79f7987b Fix #136724: Retiming keys are covered by waveform
Issue was caused by d0cf4a4a8b, where retiming keys are covered by
waveform overlays, because their drawing is cached.

Move retiming key and continuity drawing after drawing quads.

Pull Request: https://projects.blender.org/blender/blender/pulls/136742
2025-04-01 04:37:27 +02:00
Campbell Barton
281cf7ff6d Cleanup: remove dead code from BLI_str_partition_ex
The check for `from_right` was always false.
2025-04-01 13:14:28 +11:00
Campbell Barton
00deec7c66 Cleanup: spelling in comments 2025-04-01 12:37:36 +11:00
Campbell Barton
3e496a5dfe Cleanup: add missing doxygen file headers 2025-04-01 12:35:01 +11:00
Campbell Barton
7ae020ecd1 Cleanup: use our utility function to create a PyUnicode from a std:str 2025-04-01 12:33:56 +11:00
Campbell Barton
e3d6051181 Cleanup: suppress cast-function-type warnings for CLANG
Extend the existing GCC pragma's and add the warning suppression
for Cycles & Freestyle.
2025-04-01 12:06:03 +11:00
Campbell Barton
ccbf8c0544 Cleanup: resolve unknown pragma warning for CLANG 2025-04-01 12:05:25 +11:00
Campbell Barton
fc8f6ee853 Cleanup: resolve ignored qualifier warning for CLANG 2025-04-01 01:01:38 +00:00
Campbell Barton
52701243f5 Cleanup: suppress null-pointer-subtraction warning for CLANG 2025-04-01 11:57:16 +11:00
Campbell Barton
86ec6d4290 Cleanup: resolve tautological-pointer-compare warning for CLANG
The array can never be null.
2025-04-01 11:54:34 +11:00
Campbell Barton
bcdcc3dbde Refactor: use enum types for event modifiers & types
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.

This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.

Ref !136759
2025-03-31 23:48:29 +00:00
Harley Acheson
60f480f21f Fix #135982: Do Not Use Large Custom Cursors on MacOS
MacOS generally uses mouse cursors we specifically made for that
platform. But in some cases, like WM_CURSOR_WAIT, the OS does not have
an equivalent and we don't have a platform-specific one. So it then
uses of of our base custom cursors. This type of cursor is always
enlarged on Mac high-DPI displays like Retina. So no need to ever
supply larger versions of this type of cursor as it will just get
huge.

Pull Request: https://projects.blender.org/blender/blender/pulls/136005
2025-04-01 00:30:32 +02:00
Harley Acheson
72e56ab27b Fix #136781: Ensure Area Resizing Between Scroll Bars
Neighboring areas can have right-aligned and left-aligned scroll bars
that doesn't leave room for area resizing. This PR carefully reduces
the scroll bar zone size at the area edge. To ensure that the behavior
you get matches the mouse cursor you see, this corrects an error that
we were not setting cursor when transitioning from area border to
scroll bars.

Pull Request: https://projects.blender.org/blender/blender/pulls/136794
2025-03-31 22:21:05 +02:00
Pasang Bomjan
95acb63f5f UI: Nodes: Add placeholder for text button in the String input node
Pull Request: https://projects.blender.org/blender/blender/pulls/135907
2025-03-31 21:07:47 +02:00
Leon Schittek
e09b57c5d7 UI: Nodes: Add missing icons to node socket type selection lists
Add icons to the rna enum definitions for socket types so they
are displayed in all socket type selection lists like the ones on the
various loop zones.

These places were missed, when the socket icons were added in
commit 821e0024d4.

Pull Request: https://projects.blender.org/blender/blender/pulls/136707
2025-03-31 20:57:20 +02:00
Harley Acheson
cce3c27e21 UI: Use Previous Directional Cursors for Region Open Zone
Before #136334 hovering over a zone used to open closed regions, we
would show left/right or up/down directional arrow cursors. That PR
replaced those with chevron cursors that point in the specific
direction the region would open. That change has caused some confusion
so this PR restores those old cursors.

Pull Request: https://projects.blender.org/blender/blender/pulls/136583
2025-03-31 19:47:03 +02:00
Jacques Lucke
1fca4e7f87 Cleanup: quiet warnings for using deprecated sequencer properties 2025-03-31 18:59:26 +02:00
Clément Foucault
9181485931 Fix #136235: Edit UV: Crash when modifying mesh in shaded viewport
This happened because the viewport was drawn after
the UV editor when some update occur (e.g. canceling an
operator). The requested UV edit batch would require only
one specific UV channel. The viewport, in need of a different
UV channel, requested a VBO rebuild (freing the old UV VBO)
but did not correctly clear the UV batches that were referencing
the said VBO. This lead to use after free which would sometime
works because the same memory would be reused for a random new
batch.

Pull Request: https://projects.blender.org/blender/blender/pulls/136780
2025-03-31 18:45:59 +02:00
Guillermo Venegas
69a7c834b8 Refactor: UI: Use typed enum class for uiItemInternalFlag enum
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemInternalFlag` and moved to the `blender::ui`
namespace. `uiItemInternalFlag` is preserved as a shorthand for
`blender::ui::ItemInternalFlag`.
No user visible changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/136782
2025-03-31 18:23:16 +02:00
Jacques Lucke
2522f88bba Cleanup: quiet false positive dangling reference warning
I get a warning in a bunch of places where `library_ensure_catalogs_in_path` is
called. This is a known false positive of GCC. To workaround the warning, the
`AssetCatalogPath` can be constructed in a separate statement to avoid
implicitly constructing it as temporary value when calling
`library_ensure_catalogs_in_path`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136762
2025-03-31 17:55:35 +02:00
Miguel Pozo
8f63f509b6 Fix #136501: Overlay: Edit Mode Edges occluded by viewport grid
Render Overlay Meshes after the Grid.
As a side effect, in-front wireframe objects are now displayed behind
non-in-front edit mode overlays.

Co-authored-by: Clément Foucault
Pull Request: https://projects.blender.org/blender/blender/pulls/136764
2025-03-31 17:37:00 +02:00
Hans Goudey
ef86d9fe86 Cleanup: Remove ED_ prefix from private functions 2025-03-31 11:21:24 -04:00
Jeroen Bakker
3ad5721a1c Fix #136767: SubDiv: Incorrect attribute interpolation
177bbf12df solved the out of bound read
by limiting the input search. However this lead to incorrect
interpolation. This has been fixed by moving the bound check as a
post check.

Pull Request: https://projects.blender.org/blender/blender/pulls/136769
2025-03-31 15:43:01 +02:00
Guillermo Venegas
ba85f96f7a Refactor: UI: Use typed enum class for uiItemType enum
Part of incoming refactors in interface layout C++ code, this enables
forward declaring this enum type outside of `layout_interface.cc`. The
enum is renamed as `ItemType` and moved to the `blender::ui` namespace.
`uiItemType` is preserved as a shorthand for `blender::ui::ItemType`.
No user visible changes expected, layout introspection will still print
item types using property enum identifier format.

Pull Request: https://projects.blender.org/blender/blender/pulls/136740
2025-03-31 15:30:58 +02:00
Hans Goudey
571d1c5f23 Fix #136668: Curve to mesh potential crash with fill caps
Different areas of this code were using different checks for whether a
specific curve combination has caps or not. Extract the check to a separate
function to avoid that problem.
2025-03-31 09:28:30 -04:00
Hans Goudey
c7def2bb5e Revert "Fix #136668: Curve to mesh crash with fill caps and no faces in output"
This reverts commit a1c3771492.

This fix didn't address the core issue.
2025-03-31 09:28:30 -04:00
Sybren A. Stüvel
6b62ec5b3a Fix #136736: Pasting keyframes broken when action groups are collapsed
Fix an issue where copy-paste of keyframes was broken when action groups
are collapsed. It was caused by the `ANIMFILTER_LIST_VISIBLE` filter
flag; removing it (as it was before the bug-introducing commit) resolved
the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/136768
2025-03-31 15:13:04 +02:00
Jorn Visser
b1bb1d9815 Build: Make the FFTW threads library required to use FFTW
This is done because the library is necessary to make certain FFTW
functions thread safe, see #136557 as well.

Also pass each library variable separately to
`find_package_handle_standard_args` instead of as a list, as otherwise
it won't correctly detect if `libfftw3f` or `libfftw3f_threads` is
missing. This is because CMake considers a value false if it contains
`-NOTFOUND` at the end, but not if it's in the middle. For example,
CMake considers
`.../libfftw3f.a;.../libfftw3f_threads.a;FFTW3_LIBRARY_D-NOTFOUND` to be
false, but
`.../libfftw3f.a;FFTW3_LIBRARY_THREADS_F-NOTFOUND;.../libfftw3.a` to be
true.

---

I noticed that some other find modules also have the same list issue. I guess it was done this way to make CMake print all the found libraries instead of only the first.

Pull Request: https://projects.blender.org/blender/blender/pulls/136692
2025-03-31 14:42:35 +02:00
Falk David
0b2ba603d1 Fix: Node Tools: Crash in debug build using Selection node
The Selection node was creating a boolean field for a float
socket causing an assert to be hit in a debug build.

Pull Request: https://projects.blender.org/blender/blender/pulls/136766
2025-03-31 14:28:09 +02:00
Jeroen Bakker
ee8e993181 Fix #136237: Limit max material index to MAXMAT
Due to !133498 layers containing incorrect material indices could lead to generating
to many GPU resources crashing Blender. As there is a maximum number of material slots
we can limit it.

This is just a safeguard for incorrect values in material_index attribute layer. Working with
this material index attributes should automatically limit, but I leave that to the modeling
module.

Pull Request: https://projects.blender.org/blender/blender/pulls/136302
2025-03-31 13:24:39 +02:00
Aras Pranckevicius
a2ffdb74b4 Fix #136651: H265 output not compatible with Apple (Quicktime/FCP)
As per https://trac.ffmpeg.org/wiki/Encode/H.265
the video needs to have a special `hvc1` tag to be set, in order
for it to be understood by Apple products.

Pull Request: https://projects.blender.org/blender/blender/pulls/136756
2025-03-31 13:16:26 +02:00
Philipp Oeser
48f2028687 Fix #136728: Motion path keyframe number not showing on bones
This was only working if one had  `+ Non-Grouped Keyframes` enabled.So
code wasnt finding the bone name in the groups of the Action.That in
turn was caused by the fact that `animviz_calc_motionpaths` solely uses
`BKE_action_group_find_name` [which is documented to support only legacy
Actions].

To resolve, check if the action is legacy, otherwise get the
`Channelbag` and use its `channel_group_find`

Pull Request: https://projects.blender.org/blender/blender/pulls/136757
2025-03-31 12:42:02 +02:00
Jeroen Bakker
5a5471b622 Python: Add GPUShaderCreateInfo.depth_write method
Setting depth_write option of ShaderCreateInfo isn't available in
python GPU module. This PR adds support of it.

References #136732

Pull Request: https://projects.blender.org/blender/blender/pulls/136752
2025-03-31 12:37:56 +02:00
ChengduLittleA
d8167b14a7 Fix #136755: Grease Pencil: Prevent "Merge Group" run on empty groups
Similar to https://projects.blender.org/blender/blender/pulls/136652,
"Merge Group" also need to check whether there are actual layers inside
the active group, otherwise it can't merge.

Pull Request: https://projects.blender.org/blender/blender/pulls/136760
2025-03-31 12:36:16 +02:00
Jeroen Bakker
5e26f5cc2a Vulkan: Reduce lag on certain platforms.
After reviewing the locations where `GPU_flush()` are used it doesn't seem
to be harmfull to include these for the Vulkan backend as well. Hopefully
will save some lag that can happen when submitting one huge render graph.

Improved playback of rain_restaurant.blend where frames could be dropped
resulting into UI lag.

Pull Request: https://projects.blender.org/blender/blender/pulls/136654
2025-03-31 12:16:48 +02:00
Falk David
47d1d36dc4 Cleanup: Grease Pencil: Move apply_eval_grease_pencil_data function
Moves the `apply_eval_grease_pencil_data` function
to `grease_pencil_utils.cc` in the `ed::greasepencil` namespace.
2025-03-31 12:06:45 +02:00
Anthony Roberts
5dfb005cd0 Windows ARM64: GPU Subdivision: Re-enable on Qualcomm GPUs
In light of recent changes by Jeroen, #124515 seems to have been resolved properly, rather then using this workaround.

This also sidesteps the issue seen in #136633 which only happens when GPU sibdiv is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/136678
2025-03-31 11:44:50 +02:00