Commit Graph

152064 Commits

Author SHA1 Message Date
Campbell Barton
c3cdc11283 CMake: quiet build warnings from fmtlib
Reference fmtlib as a system include to suppress noisy messages.
2025-07-16 15:32:03 +10:00
quackarooni
5bb21bfa07 Fix #141610: Nodes: Active selection points to internal toggle socket after running "Remove Item"
Panel toggles are implemented by having a boolean socket with
`is_panel_toggle` set to `True`, as the first item in that panel's children.
These sockets are then hidden from the user, as the checkbox gets drawn
in the panel's UI.

In specific circumstances described in the bug report, the active selection
can sometimes land on these sockets. Leading to the user being able to
directly access these internal sockets.

The changes in the patch make the "Remove Item" operator check if
the resulting selection lands in a toggle socket, and move the selection
to that toggle's parent panel if that is the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/141859
2025-07-16 07:11:14 +02:00
Campbell Barton
75dd3bc1e0 Viewport: respect grid scale in walk-mode for heights & gravity
Navigating around a larger/smaller scene wasn't scaling the height
& gravity by the grid size.
2025-07-16 04:59:02 +00:00
Campbell Barton
bedaafee78 Fix #138359: Walk teleport fails when the scene scale isn't 1.0
Teleport was either moving too far or not far enough with a scaled
scene. Remove scene scaling in this case it doesn't make sense when
interpolating between two points.
2025-07-16 14:54:22 +10:00
John Kiril Swenson
d910fb88b0 VSE: Clamp strip handles to video/audio bounds
This initial commit properly clamps handles for video/audio strips, and
provides functionality to enable/disable the behavior for all strip types
(addresses #90280).

Toggling handle clamping is done with "C",
just like with the redesigned slip operator (#137072).

If a strip is not already clamped when you start moving its handles,
then clamping behavior is disabled starting out. This means no abrupt
clamp until you explicitly ask for it.

Transform logic was altered, fixing a few bugs:
- When initializing a transform, `createTransSeqData` would already
  create some clamping data for channels. This patch replaces it with
  `offset_clamp` (for unconditional clamping which cannot be disabled)
  and `handle_xmin/xmax` (for hold offset clamping, which is optional).
    - Collecting this data ahead of time is necessary for the double
      handle tweak case -- `flushTransSeq` only works one strip at a
      time, so we can't clamp post-hoc.
- In `applySeqSlideValue`, we apply `transform_convert_sequencer_clamp`
  before values are printed to the header, but let the unclamped values
  get flushed to the strips themselves. This is so that we can have the
  data later at the individual strip level to recalculate clamps.
  Otherwise, if transform values are clamped preemptively, then we have
  no idea whether strips are clamped vs. merely resting at their
  boundaries.

Note that currently, handle clamping is drawn identically to overlaps.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/134319
2025-07-16 06:16:19 +02:00
John Kiril Swenson
1cb30b9d1e Fix: VSE: Metastack channel preview with negative values
As mentioned in comments on #43646, a negative channel value in preview
view settings can be used to climb the metastack. But the functionality
did not work as expected in most cases.

This combines a one-line fix by Sergey with an updated description for the
property which documents the feature.

In the future we may want to change its operation to be less obscure,
since it has some use-cases in aligning strips within a metastrip with
those outside of it.
2025-07-16 06:12:09 +02:00
Germano Cavalcante
dfd4d2914f Refactor: Bypass DEG_foreach_dependent_ID_component when not needed
The `DEG_foreach_dependent_ID_component` is only used to mark objects
whose base will have `BA_SNAP_FIX_DEPS_FIASCO`.

If this flag is not used, the `DEG_foreach_dependent_ID_component` is
also not needed.
2025-07-15 20:18:57 -03:00
Germano Cavalcante
a2a2638a57 Fix: Assert finishing transformation with an 'Affect Only' option active
Attempt to use C-style MEM_freeN on a pointer created with CPP-style
MEM_new

Pull Request: https://projects.blender.org/blender/blender/pulls/141999
2025-07-15 23:54:48 +02:00
Hans Goudey
0781b90962 Cleanup: Formatting 2025-07-15 17:24:46 -04:00
Clément Foucault
4ebaee0aa1 Fix #106312: Workbench: Texture interpolation is shared across material
This was caused by the Material Sub pass being
shared for all materials using a same texture.
This patch simply adds the sampler state inside the
Map key. This will create one unique subpass for each
texture and for each sampler state.

Pull Request: https://projects.blender.org/blender/blender/pulls/141978
2025-07-15 22:47:17 +02:00
Hans Goudey
2cf9cba182 Cleanup: Remove else after return 2025-07-15 16:37:37 -04:00
Hans Goudey
98a1816e01 Cleanup: Clarify comment position in custom data type conversion 2025-07-15 16:37:37 -04:00
RedMser
e9d1fa944e Fix #138863: Filter Out Archives When Adding Quick Access Items on Windows
On Windows, filter out the most common archive file formats when adding
OS Quick Access items to the File Browser's system list. These items
can be opened like folders in the OS, but not within File Browser.

Pull Request: https://projects.blender.org/blender/blender/pulls/138884
2025-07-15 22:01:13 +02:00
Germano Cavalcante
bda79fe4c3 Fix #121266: Snap toggle in UI not updating during transform
During transform operations, the 'Snap Toggle' shortcut
(default: Shift + Tab) enables or disables snapping.

Previously, the UI did not reflect the toggle state until the operation
was finished.

It now updates live during the operation.
2025-07-15 16:51:30 -03:00
Harley Acheson
eed8683234 Fix #141885: Do Not Clip Panel Title If No Drag Widget
Changes in ca3076ed35 clips panel titles at the left edge of the drag
widget. This PR only does this when there actually is a drag widget.

Pull Request: https://projects.blender.org/blender/blender/pulls/141979
2025-07-15 20:37:17 +02:00
Jesse Yurkovich
a8668ddbd5 Fix: Use correct thin-film setup for MaterialX glass bsdf
Broken by cf92af3ac4

The `thin_film_bsdf` node no longer exists in the version of MaterialX
that we use. It's been removed in favor of specifying the thin-film
values directly on the `dielectric_bsdf`, `conductor_bsdf`, or
`generalized_schlick_bsdf` nodes.

There is another use of the node inside the Principled BSDF's `BSDF`
output case. The `Surface` case is correct but the BSDF layering setup
still needs addressed. This PR will get the tests passing though.

Pull Request: https://projects.blender.org/blender/blender/pulls/141974
2025-07-15 20:28:45 +02:00
Sean Kim
ae9a3f28d5 Cleanup: Remove unused active_vert_co from CursorGeometryInfo
Usage of the field was removed in 5f51438185

Pull Request: https://projects.blender.org/blender/blender/pulls/141923
2025-07-15 19:56:46 +02:00
Sean Kim
e1d46c1570 BLI: Ensure rcp and safe_rcp are not used with integral types
Since we expect the result of `rcp` and `safe_rcp` to always be in the
range of [0, 1], it doesn't make sense to allow passing in integer types
without casting them, as this has a high possibility of introducing
unwanted behavior by only returning either 0 or 1.

To prevent this, this commit adds a static assert on the type.

Pull Request: https://projects.blender.org/blender/blender/pulls/141567
2025-07-15 19:12:34 +02:00
Hans Goudey
191a1a5ba7 Cleanup: Use C++ vector types for CustomData layer data in RNA 2025-07-15 12:32:51 -04:00
Ray Molenkamp
b150f56a5d Revert "Deps_builder: pydantic 2.11.7"
This reverts commit 81e862140f

binary packages turned out to have issues for debug builds on windows
as they link to python_311d.dll and none of the binary packages offfered
on pypi offered a debug build. Building pydantic from source was rejected
due to no rust build infrastructure being in place yet and deemed not
worth the effort for this one library dependency, an alternate solution
was chosen by the assets team that requested this dependency.
2025-07-15 08:09:37 -06:00
Campbell Barton
a29a631834 Fix #111060: Back side of rotate gizmos shows when zoomed in
Resolve regression in v3.5 displaying rotation gizmos when zoomed in.
2025-07-15 22:18:31 +10:00
Richard Antalik
cadbf9702b Fix #141780: Images rotate bacwards in VSE
58af30f9b9 changed sign of rotation. The sign was previously negated in
VSE for image to follow mouse cursor. This is no longer necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/141782
2025-07-15 14:12:44 +02:00
Campbell Barton
1ec2ef4063 Cleanup: de-duplicate dial gizmo clip plane calculation 2025-07-15 22:05:47 +10:00
Habib Gahbiche
4ca460d23b Compositor: increase default node size to improve readability
Increase the default width of some nodes by around 10% or less in order
to improve readability of the default parameters or labels under
default zoom level and default UI scale.

The following nodes are affected:
- Anti-aliasing
- Bokeh Blur
- Bokeh Image
- Chroma Key
- Color Key
- Color Spill
- Convert Colorspace
- Disatnace Key
- Double Edge Mask
- Image
- Keying
- Kuwahara
- Voronoi Texture
- Noise Texture
- Brick Texture

See PR for screenshot examples.

Pull Request: https://projects.blender.org/blender/blender/pulls/141662
2025-07-15 12:27:00 +02:00
Campbell Barton
b44b92c71f Fix #111098: Orbit around selection uses world origin
The orbit fallback position could be used before being initialized
from the selection (zeroed values).
Further, the value could be used between different blend files where
the previous values wouldn't make sense.

Move the center point storage from a static variable to View3D runtime
data and only use when initialized from the selection.
2025-07-15 18:02:37 +10:00
Christoph Neuhauser
a889aa9e38 WM: Switch to high-resolution timers on Windows for sleeping
This PR introduces a more precise sleep function `BLI_time_sleep_duration`
using high-resolution timers on Windows. By default, Windows only has a
resolution of 15.25ms for the regular `Sleep` function. Using more precise
timers makes sure that Blender can wake from sleep quicker and improves
performance at high frame rates.

High-resolution timers may have better energy efficiency than using
`timeBeginPeriod`/`timeEndPeriod` that change the timer resolution globally
on some versions of Windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/140221
2025-07-15 10:02:09 +02:00
Campbell Barton
f62422884b Fix: correction to recent WM_cursor_time fix
Recent fix to ensure cursors never display negative numbers [0]
didn't work when the input value was std::numeric_limits<int>::min().

Resolve using an unsigned cast before negating.

[0]: 747ab523c3
2025-07-15 15:27:01 +10:00
Jacques Lucke
655afbb235 Fix: Geometry Nodes: output fields from closures
This fixes the anonymous attribute lifetime inferencing for the closure zone and
the evaluate closure node. It also adds new regression tests for cases where a
closure outputs a field.

Pull Request: https://projects.blender.org/blender/blender/pulls/141925
2025-07-15 06:48:24 +02:00
Campbell Barton
747ab523c3 Fix: crash displaying negative numbers in WM_cursor_time
Displaying negative numbers would attempt to read from a negative
array index on systems that don't support RGBA cursors.
Resolving by making the value absolute before displaying.
2025-07-15 14:33:50 +10:00
Campbell Barton
3a55348492 WM: various improvements to text cursors
- Use a bounding box based on the fonts dimensions to fix jittering
  as numbers change because of differences in glyph bounds.
- Always show a cursor even if the text is empty.
- Use integer arithmetic to simplify bounds calculations and avoid
  having to round the resulting values.
- Increase the maximum width of the text to twice the cursor size
  since the text could be quite small when limited to the cursor size.
- Extract buffer flip-Y into a function.
- Define CURSOR_HARDWARE_SIZE_MAX and reuse this constant.
2025-07-15 13:55:22 +10:00
Campbell Barton
54ac76e425 BLI_string_utf8: add BLI_str_utf8_column_count
Add a utility function to count the number of columns in a string.
This is just a convenience wrapper around BLI_str_utf8_offset_to_column.
2025-07-15 13:44:10 +10:00
Guillermo Venegas
1a247fbaa8 Refactor: WM: Make OperatorCallContext an enum class, move to namespace
This allows forward declaring `OpCallContext`, avoiding the
transitive include `WM_Types.hh` in `UI_interface_layout.hh`

Pull Request: https://projects.blender.org/blender/blender/pulls/141804
2025-07-15 03:08:04 +02:00
Sean Kim
be9cb07654 Fix #141753: Surface Smooth Mesh Filter causes NaN propagation
When the mesh filter is used, it is possible for some runtime values
stored in `surface_smooth_laplacian_disp` to be uninitiailized. This
happens when a large portion of the mesh is masked or invisible, as the
node mask then skips processing of certain vertices.

To fix this, zero initialize the array when it is intiially allocated.

Pull Request: https://projects.blender.org/blender/blender/pulls/141914
2025-07-15 02:10:55 +02:00
Sean Kim
e6b3c2b026 Tests: Add UI test for selecting brush via brush popover
This commit adds a test to ensure that the asset shelf popup works as
expected inside Sculpt Mode.

Related to #141235

Pull Request: https://projects.blender.org/blender/blender/pulls/141250
2025-07-15 02:09:48 +02:00
Ray Molenkamp
097531ccbf data_to_c: CMake: Speed-up data_to_c
This moves the logic to create the parent folder to data_to_c itself
rather than having cmake do it, preventing several thousand cmake instances
to be started.

see pr#141404 for details/benchmarks

Pull Request: https://projects.blender.org/blender/blender/pulls/141404
2025-07-15 02:08:14 +02:00
Germano Cavalcante
32a6e14d41 Fix #54325: Shrink/Fatten "Offset Even" can not be used as default
The default keymap item that triggers `Shrink/Fatten` uses the `Alt`
modifier, which coincidentally is the same key that toggles
`Offset Even`. What is undesirable.

The solution is to alternate between Alt Press and Alt Release
depending on the `Offset Even` property.

Pull Request: https://projects.blender.org/blender/blender/pulls/141904
2025-07-15 01:56:25 +02:00
Sean Kim
8feef54afa Refactor: Use C++ math type for ReshapeGridElement structs
Pull Request: https://projects.blender.org/blender/blender/pulls/141698
2025-07-15 00:01:12 +02:00
Sean Kim
a138106fac Cleanup: Remove unnecessary const and enum prefixes
Pull Request: https://projects.blender.org/blender/blender/pulls/141691
2025-07-14 23:58:26 +02:00
Jesse Yurkovich
cbb6cdf8d7 Fix #141633: Various subdivision problems during Alembic import
This fixes 4 bugs all conspiring to make the referenced SubD scenario
quite broken:

- When manually creating a MeshSequenceCache, the reading of edge and
  vertex crease data was skipped. Fixed by reading crease data inside
  the common `read_mesh` method.
- When importing an Alembic with animated edge or vertex crease data, a
  MeshSequenceCache modifier was not being added to the object. This was
  due to not checking the relevant crease properties and required adding
  a specialized `has_animations` function.
- When importing animated vertex crease data, a duplicate `vertex_crease`
  attribute would be created, breaking the animation. Fixed by using the
  attribute API rather than custom data.
- The MeshSequenceCache scenario would call into the Alembic Mesh reader
  which ended up referencing deallocated stack memory for the
  ImportSettings. In release builds this would cause sporadic failures
  because the value of `blender_archive_version_prior_44` would be
  random. There was already a very old TODO for this and we finally
  really needed to address it.

A new test was added which exports animated creases on two meshes and
re-imports them back in. It verifies that each mesh gets a
MeshSequenceCache modifier added and also ensures the values of the
creases are correct for all frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/141646
2025-07-14 21:49:23 +02:00
Miguel Pozo
05dcc0377b Fix: GPU: Missing error logs
Regression from d5f84d0016.
2025-07-14 18:53:35 +02:00
Brecht Van Lommel
40339e3edd Merge branch 'blender-v4.5-release' 2025-07-14 17:39:16 +02:00
Brecht Van Lommel
c5df70a7d4 Fix #141779: Adaptive subdivision + custom OSL camera crash
This is not an actual solution, it falls back to a perspective camera instead
of crashing. Note full_rastertocamera exists specifically for computing raster
size for adaptive subdivision, and changing it should not affect anything else.

Pull Request: https://projects.blender.org/blender/blender/pulls/141905
2025-07-14 17:36:29 +02:00
илья _
aa147d5323 Tests: Geometry Nodes: Offset Corner in Face node invalid inputs
Mainly cover issue reported in #140234.

Pull Request: https://projects.blender.org/blender/blender/pulls/141855
2025-07-14 17:24:02 +02:00
Michael Jones
9d9d0a7259 Cycles: MTLAccelerationStructureUsagePreferFastIntersection on macOS>=26
macOS 26 introduces a new BVH usage hint: [MTLAccelerationStructureUsagePreferFastIntersection](https://developer.apple.com/documentation/metal/mtlaccelerationstructureusage/preferfastintersection?changes=_3&language=objc)

This will only be compiled if built with Xcode >= 26.

Pull Request: https://projects.blender.org/blender/blender/pulls/141891
2025-07-14 16:59:47 +02:00
Jacques Lucke
00c81f5113 Merge branch 'blender-v4.5-release' 2025-07-14 16:30:38 +02:00
Jacques Lucke
7f07124d30 Fix #141847: Input node properties missing in sidebar
This was caused by 87c011f8bb. The drawing code for the input nodes was moved
into a new `custom_draw_fn` callback on the socket declaration. This was not
taken into account when drawing the sidebar yet, which is an oversight and was
not an intentional change.

This fix applies to all the nodes that use the new custom draw function.

Pull Request: https://projects.blender.org/blender/blender/pulls/141872
2025-07-14 16:29:19 +02:00
Jacques Lucke
1f2f9aef51 Fix #141800: crash when showing node warnings during playback
The node warnings were only referenced by the tooltip function. Since they are
recreated on every evaluation, this resulted in a use-after-free. The fix is to
just copy the node warnings into the callback.

Of course this extra copy does have some performance implications, but I don't
think those are significant currently.

Pull Request: https://projects.blender.org/blender/blender/pulls/141875
2025-07-14 16:28:39 +02:00
Hans Goudey
c3181490f3 Cleanup: Formatting 2025-07-14 10:22:46 -04:00
YimingWu
4096309753 Fix #141819: Interface Use a flag for WM_set_locked_interface
Different operations may need to lock different part of the interface,
e.g. for rendering, the image editor may still need refreshing while the
interface is locked, but when baking data into a scene, the image editor
needs to be locked because it is not thread safe to get data from a
partially evaluated depsgraph.

This is a better fix on top of 7c8b8b2457
that addresses the root cause with more flexibility for future
operations that requires different interface locking strategy as
well.

Pull Request: https://projects.blender.org/blender/blender/pulls/141866
2025-07-14 16:17:46 +02:00
Sebastian Parborg
ad2e7434c8 Fix: Local method in versioning_500 was not static 2025-07-14 15:50:03 +02:00