Commit Graph

118529 Commits

Author SHA1 Message Date
Jeroen Bakker
d5bef6cb01 Cleanup: Remove unused code 2025-03-27 14:09:15 +01:00
Sybren A. Stüvel
06a69cfadf Anim: Allow Stash and Push Down on empty Action
Add support for using the Stash (to NLA) and Push Down operators on
empty Actions. In the past years, the NLA has seen stability updates
that ensure strips are at least a single frame long, and with that even
pushing down an empty Action will create a visible (albeit tiny) NLA
strip. There doesn't seem to be a practical reason to disallow this any
more.

Pull Request: https://projects.blender.org/blender/blender/pulls/136604
2025-03-27 12:53:24 +01:00
Sybren A. Stüvel
6d3c621958 Fix #136596: Keying slotless NLA strip does not update the strip's slot
It is possible to un-assign the action slot from an NLA strip. If then
you enter tweak mode on it and insert keys, a new slot is created on the
Action (so far so good). However, exiting tweak mode did not assign that
slot to the NLA strip, deactivating the animation. This is now solved.

The slot assignment is done when exiting tweak mode because that's
when the whole "sync from assigned Action back to the NLA strip"
happens. Also things like syncing the strip length is done at
tweak-exit, so that seemed like the right place to me to do this too.

Pull Request: https://projects.blender.org/blender/blender/pulls/136601
2025-03-27 12:30:09 +01:00
Sybren A. Stüvel
307147c99c Anim: versioning after #136347 fixed keyframe interpolation flags
Update all F-Curves so they have the correct flags (`FCURVE_INT_VALUES`,
`FCURVE_DISCRETE_VALUES`) for the RNA property type that they animate.
The bug that caused these flags to be incorrect (#136347) is already
fixed. This commit ensures that F-Curves that were created while the bug
was in a Blender release are updated to ensure they have the correct
flags.

This is quite important to fix, as otherwise enum properties will
actually be interpolated. Imagine the "fun" when a rig is going
through all the intermediate rotation modes when it was intended to
switch from "Quaternion" to "ZYX".

Even before this commit, these flags were already recomputed on key
insertion (at least the ones through the UI). The versioning code simply
runs this update on all existing F-Curves.

Since this may have some performance impact (doing an RNA path resolve
on all F-Curves on all Actions), the versioning code is only run when
the blend file is from 4.4 or newer, as the bug was introduced in that
release.

Pull Request: https://projects.blender.org/blender/blender/pulls/136512
2025-03-27 12:26:22 +01:00
Pratik Borhade
128920633a UI: Show Curves info in viewport statistics
Count total number of available and selected points for Curves object
and show them in viewport stats. Right now, they are displayed zero in
edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/136070
2025-03-27 12:03:30 +01:00
Jacques Lucke
1885c4c967 Fix #136564: Geometry Nodes: bake is not loaded with custom normals
The bake was written correctly, but loading did not handle the 2d int16 attribute.
2025-03-27 11:06:28 +01:00
Jorn Visser
3561b11851 Fix #136310: Crash when using both viewport and normal compositor with fog glow
The issue is caused by the fact that when both compositors are used,
`fftwf_plan_dft_r2c_2d` can end up being called in parallel, which is
only thread-safe if `fftwf_make_planner_thread_safe` is called before.
This is done by `fftw::initialize_float`, but only if the FFTW threading
support library is available. Said library was not detected correctly on
Windows because of a typo, which this change addresses. This should also
make the fog glow faster on Windows because it'll now use multithreaded
FFT as intended.

This change also moves the call to `initialize_float` to the main
function because the FFTW functions it calls are not thread-safe and
because FFTW is also used by Audaspace, which cannot call it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136557
2025-03-27 10:20:15 +01:00
Omar Emara
cf25a34fe9 Compositor: Add Glare Suppress Highlights boolean input
The Glare node currently has a Maximum Highlights input, which has a
special value of 0.0, where the maximum is implicitly set to infinity,
that is, no suppression of highlights happen at that special value. Such
special values are hard to discover and make sliders non-continuous.

To fix this, we introduce a new panel toggle input called Suppress
Highlights, which the user can enable then control the maximum value.
This also have the advantage that the Maximum value is more clear, since
it is now under a panel more clearly named.

This is now possible since the introduction of boolean sockets and node
panel toggle inputs.

Pull Request: https://projects.blender.org/blender/blender/pulls/136309
2025-03-27 09:22:04 +01:00
Patrick Huang
8fd0a0e3f1 Fix #136361: Change empty size when applying scale transform.
Apply transform behavior for empties is now consistent.
Applying scale always changes empty size to keep apparent size.
Previously, empty size is only changed when applying scale only.

Pull Request: https://projects.blender.org/blender/blender/pulls/136534
2025-03-27 08:09:04 +01:00
Jesse Yurkovich
b6f432254c Cleanup: USD: Remove unused argument for create_object
The `motionSampleTime` argument to `create_object` has been unused since
the dawn of time, and it's not expected to be used in the future either.

Remove the clutter.

Pull Request: https://projects.blender.org/blender/blender/pulls/136587
2025-03-27 03:52:05 +01:00
Alaska
2e829ca4cf Fix #136303: Normalize the normals on the Ambient Occlusion node
This commit simply normalizes the normals of the Ambient occlusion
node before computing the output to avoid odd behaviour with
unnormalized normals.

Pull Request: https://projects.blender.org/blender/blender/pulls/136315
2025-03-27 02:58:19 +01:00
Sean Kim
fd2a187355 Cleanup: Remove StrokeCache rcti variables
Both values are unused.

* `current_r` is only ever set and never read from
* `previous_r` is only ever read from and is never set, because it is
  always empty, it is never unioned with the current `rcti`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136586
2025-03-27 02:31:31 +01:00
Campbell Barton
42ad772a1f Cleanup: spelling & repeated terms (make check_spelling_*)
Also use comment blocks for English text.
2025-03-27 01:13:34 +00:00
Campbell Barton
6f95b7e9a4 Cleanup: de-duplicate modifier flag logic in key-map item creation 2025-03-27 01:13:32 +00:00
Nicola
5e873ee3ec Fix: Canceling sculpt transform tool leads to invalid display of mesh
Caused by bc3c6c4e7c

`cancel_modal_transform` restores the original positions, but it was
missing calls to update the vertex normals and the bounds of the BVH
nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/136580
2025-03-27 01:12:19 +01:00
Sean Kim
88ee723ed5 Fix: Potential divide by 0
This situation is unlikely to happen in practice, as it would require
there to be either no elements in the mesh, or every average translation
to be a 0-length vector.

Pull Request: https://projects.blender.org/blender/blender/pulls/136572
2025-03-27 01:02:47 +01:00
Campbell Barton
7b5428bfa7 Cleanup: remove KM_{MOD}_ANY flags
Even though the doc-string notes that they're only used for
function parameters, it looks as if they might be used for
`wmEvent::modifier` and are exposed in a prominent location.

Remove the flags & replace them with a macro that bit-shifts the
existing modifier values which is more clearly intended to be used
with `KeyMapItem_Params`.

Ref !136539
2025-03-26 23:29:33 +00:00
David Murmann
afee81753e OpenEXR: Preserve compression and depth settings when re-saving file
Set the flags on the image buffer when loading an EXR file, so they can be
used when saving.

This also removes IB_halffloat and replaces it by the file options flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/135656
2025-03-26 21:35:20 +01:00
Jacques Lucke
202db40afb Refactor: move uvproject code from blenlib to blenkernel
I'm moving this for two (related) reasons:
* It depends a lot on the specifics of `Camera` and `Object` data-blocks.
* It links `Object::object_to_world()` which is not an inline function and thus
  easily leads to linker errors. It mostly seems like luck that this is not
  breaking our build due to early dead code elimination when linking binaries
  which use the blenlib static library such as `msgfmt`.

I found this while working on a compilation tool which would not be as lucky and
has a linker error because of the dependence on `Object::object_to_world`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136547
2025-03-26 20:51:57 +01:00
Harley Acheson
3dc78529f2 Fix #136504: Clamp Scaling of Color Picker Value Handle
If you scale down the color pickers to very small sizes the calculation
of the handle size of the value slider will cause it to proportionally
increase as it all approaches zero. This PR just calculates the size in
a better way and clamps it as well. For both the round and square
versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/136566
2025-03-26 18:32:29 +01:00
Omar Emara
c0fe2ef766 Compositor: Use input order for unset domain priority
This patch makes it such that the compositor fallback to using the
order of the inputs to infer the domain priority if no domain priority
is specified. This is more robust since some nodes do not declare their
domain priorities and indirectly rely on the order of insertions in some
containers and thus might fail in the future.

We opt for this as opposed to requiting all nodes to declare their
priorities for code brevity.
2025-03-26 16:14:05 +02:00
Hans Goudey
3bca04b172 Cleanup: Remove matrix copy from MeshRenderData 2025-03-26 09:49:54 -04:00
Weizhen Huang
1f12244f73 Fix: EEVEE bump height connecting to the wrong link after recent change
Pull Request: https://projects.blender.org/blender/blender/pulls/136546
2025-03-26 14:36:24 +01:00
Omar Emara
36154a1ab4 Compositor: Initial support for implicit inputs
This patch adds initial support for implicit inputs in pixel operations.
This is currently a non-functional change but will be used in the
future to support implicit inputs in texture nodes or so.

This works by exposing extra inputs to pixel operation for each of the
supported implicit input types if needed, and linking those inputs to
instances of the ImplicitInputOperation operation.

Only a single implicit input exist for now and we do not differentiate
between any of the implicit inputs type. In order to do that, we need to
refactor how input declarations for implicit inputs happen, since they
are now tied to the Geometry Nodes specifically.
2025-03-26 13:42:21 +02:00
Sergey Sharybin
2320d2ce01 Fix: Missing depsgraph tag in image reload operator
Make the code match rna_Image_reload_update().

Ref #136537
2025-03-26 10:27:37 +01:00
Andrej730
ad5494d7ac PyDoc: bpy.types.Operator docs - add note on execution context
Clarify the default behavior when invoke and execute is called.

Ref: !135854
2025-03-26 17:02:40 +11:00
Andrej730
224b8bb116 PyDoc: add node classes to register_class doc-string
Ref: !136375
2025-03-26 16:33:34 +11:00
Campbell Barton
6960d05df8 Fix: exception showing touch-pad preferences
Regression in [0] returned null without an exception set.

[0]: d9f38fca5f
2025-03-26 15:34:07 +11:00
Campbell Barton
9360884310 Fix: build error with MSVC 2025-03-26 14:14:35 +11:00
Kace
200603c0b2 VSE: Fix Delete Retiming Keys in Context Menu
Update the context menu to use `retiming_key_delete`.
Also update the corresponding operator's description to match its purpose.

Pull Request: https://projects.blender.org/blender/blender/pulls/136348
2025-03-26 04:00:35 +01:00
Campbell Barton
75202b8e38 Fix: error in keymap creation from recent addition of "Hyper"
Correct error in [0] which used an `int8_t` to store
`KM_{modifier}_ANY` flags which exceed the size of an int8_t.

[0] 5e2b421996
2025-03-26 12:38:27 +11:00
Hans Goudey
847f0ca0ba Cleanup: Formatting 2025-03-25 20:23:31 -04:00
Campbell Barton
5e2b421996 WM: support the "Hyper" modifier key on Linux
Add support for a 5th modifier key called "hyper",
this is a modifier supported on Wayland & X11 although
other platforms could support an additional modifier too.

Both GNOME and KDE can map CapsLock to Hyper.
Other compositors can use the XKB_DEFAULT_OPTIONS environment variable.

This allows users to have an additional modifier for their own use
that doesn't conflict with other keys.

Ref !136340
2025-03-26 10:39:55 +11:00
Campbell Barton
241f626015 Cleanup: use a define for the number of modifiers for key-maps & events 2025-03-26 10:38:08 +11:00
Harley Acheson
d9dbd1bafd Fix: Reset Widths After Hiding Region
Some regions, like toolbars and sidebars, can be dragged open and
closed. But this often doesn't work correctly a second time because
we don't update our saved widths once the area is hidden. This results
in an incorrect offset. This PR just resets the saved widths to zero
when the region is hidden so this doesn't occur. Note that this does
not affect the ability to just click and release on the widget, only
dragging from it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136527
2025-03-26 00:29:27 +01:00
John Kiril Swenson
b729928897 Cleanup: VSE: Rename Keymaps
Rename to be more consistent with other Blender keymaps, as well as the
naming convention used in "View Type."

- "SequencerCommon" -> "Video Sequence Editor"
- "SequencerPreview" -> "Preview"
- "Sequencer Timeline Tool" -> "Sequencer Tool"
- "Sequencer Preview Tool" -> "Preview Tool"

There is versioning in place to make sure custom keyconfigs keep working.

Once #131102 goes through, if we would like to rename the "Sequencer"
view type to "Timeline" or "Sequencer Timeline," then we can make the
necessary changes here too.

Pull Request: https://projects.blender.org/blender/blender/pulls/136217
2025-03-25 23:46:15 +01:00
Richard Antalik
196d07a5aa Fix build error
Likely caused by bad merge in 0b633fab3e.
2025-03-25 23:23:52 +01:00
Richard Antalik
0b633fab3e Fix #135631: Locked strip visibility can't be changed
Strip locking was meant to be used with strip transformation only. So
the check, whether strip is locked is removed from hide/unhide operator.

Further it was requested to lock sound strip subframe offset. Since this
is time related property, it was moved to time panel. This also
addresses request to make it more obvious, why the value can't be
changed.
The name of the property was clarified from "Offset" to
"Sound offset", because there are another 2 offsets in the panel.

Finally, when channel is locked, properties in side panel now reflects
this state. This is done by adding RNA get function for `Strip.lock`
property. Function `seq::transform_is_locked` is used instead of
checking `SEQ_LOCK` flag, because it also checks channel state. With
this setup, the lock property can't be disabled while channel is locked.
However strip lock flag will be unset, which can be prevented. (I am not sure which is better. Both are fine in my eyes.)

Pull Request: https://projects.blender.org/blender/blender/pulls/135831
2025-03-25 21:50:05 +01:00
il4n
3e023fcf79 VSE: Slip keyframes with strip content
The "slip strip contents" operator in the VSE now can move the strip
keyframes. There is a property to enable keyframe slipping.
The property is disabled by default, mainly because animation is
often used for fade in/out, which would be annoying if it moved with
content.

Pull Request: https://projects.blender.org/blender/blender/pulls/136386
2025-03-25 21:24:07 +01:00
Brecht Van Lommel
a7026e817c Fix: EEVEE bump node issue after filter width addition
Ref #136465

Pull Request: https://projects.blender.org/blender/blender/pulls/136519
2025-03-25 21:03:44 +01:00
Leon Schittek
821e0024d4 UI: Nodes: Add icons to socket type selection list
Add colored icons for node sockets based on the existing socket
draw function.

Resolves #89898

Pull Request: https://projects.blender.org/blender/blender/pulls/136212
2025-03-25 18:11:27 +01:00
Hans Goudey
9b70851d91 Draw: Refactor mesh extraction to avoid creating uninitialized buffers
The initial goal of this PR is to avoid creating vertex and index
buffers as part of the "request" phase of the drawing loop. Conflating
requesting and creating index buffers might not sound so bad, but it
ends up significantly complicating the whole process. It is also
incompatible with a future buffer cache that would allow avoiding
re-uploading mesh buffers.

Specifically, this means removing the use of `DRW_vbo_request` and
`DRW_ibo_request` from the mesh batch extraction process. Instead, a
list of buffer types is gathered based on the requested batches. Then
that list is filtered to find the batches that haven't been requested
yet. Overall I find the new process much easier to understand.

A few examples of simplifications this allows are avoiding allocating
`MeshRenderData` on the heap, and the removal of its `use_final_mesh`
member. That's just replaced by passing the necessary information
through the call stack.

Another notable difference is that for meshes, EEVEE's velocity module
now requests a batch that contains the buffer rather than just requesting
the buffer itself. This is just simpler to get working since it doesn't require
a separate code path.

The task graph argument for extraction is unused after this change. It wasn't
used effectively anyway; a simpler method of multithreading extractions is
used in this PR. I didn't remove it completely because it will probably be
repurposed in the next step of this project.

The next step in this project is to replace `MeshBufferList` with a
global cache that's keyed based on the mesh data that compromises each
batch, when possible (i.e. for non edit-mode meshes). This changes above
should be applied to other object types too.

Pull Request: https://projects.blender.org/blender/blender/pulls/135699
2025-03-25 18:09:38 +01:00
Leon Schittek
5d3d0af750 Fix #106594: Move shrinking frames based on their children
Rather than transforming the nodes inside shrinking frames together with
their parent, they are now transformed individually. That way the nodes
are aligned with the grid when snapping and the frame is adjusted by
the automatic resizing.

This makes the grid alignment of nodes is consistent, no matter whether
the node or its parent frame is transformed.

The behavior for manually resized frames is unchanged.

Pull Request: https://projects.blender.org/blender/blender/pulls/136381
2025-03-25 18:02:35 +01:00
Miguel Pozo
8b831be87f Fix #136422: Workbench: Missing shadows for backface culled non-manifold meshes
Regression caused by 20d09435ab.
Ensure compute_visibility runs again after updating the mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/136507
2025-03-25 17:51:07 +01:00
Sean Kim
111e60ffb2 Cleanup: Rework sculpt_undo.cc file comment
* Removes outdated paragraph about OPTYPE_UNDO
* Adds # prefix for method references

Pull Request: https://projects.blender.org/blender/blender/pulls/136484
2025-03-25 17:01:58 +01:00
Hans Goudey
402f349160 BLI: Make Map, Set, VectorSet slightly smaller by making a field static
max_load_factor_ is never modified, it can be static. This makes the
classes 8 bytes smaller because of their 8 byte alignment.

Pull Request: https://projects.blender.org/blender/blender/pulls/136505
2025-03-25 16:50:21 +01:00
Brecht Van Lommel
f987ef7b6e Shaders: Add Filter Width input to Bump node
This makes it possible to restore previous Blender 4.3 behavior of bump
mapping, where the large filter width was sometimes (ab)used to get a bevel
like effect on stepwise textures.

For bump from the displacement socket, filter width remains fixed at 0.1.

Ref #133991, #135841

Pull Request: https://projects.blender.org/blender/blender/pulls/136465
2025-03-25 16:29:13 +01:00
Hans Goudey
2663c840df Geometry Nodes: Improve performance with many inputs
Resolves #136183

To avoid quadratic worst case runtime when gathering values from
the modifier properties, build a temporary VectorSet of the modifier's
IDProperties. In the file from #136183, this change improves playback
performance by 1.4x for me, from 50 to 70ms.

Ideally IDProperty groups would have constant time lookup on their
own, but that's a much larger change, and this smaller change for just
Geometry Nodes is not so invasive.

Pull Request: https://projects.blender.org/blender/blender/pulls/136463
2025-03-25 15:40:32 +01:00
Miguel Pozo
dcaa945293 Fix: Renderdoc sessions crash on startup (WGL)
The crash regression comes from 583e2b7240.

Pass the s_sharedHGLRC directly to wglCreateContextAttribsARB instead
of using wglShareLists.
Context: https://github.com/baldurk/renderdoc/issues/1224

This doesn't only fix the recent regression, but solves all the long
standing issues with Renderdoc on Windows (F12 rendering support,
multiple windows, deferred compilation...).

(Fix suggested by @LazyDodo)

Pull Request: https://projects.blender.org/blender/blender/pulls/136140
2025-03-25 15:34:48 +01:00
Hans Goudey
fe52284be9 Fix #136378: Curve custom normals incorrectly propagated
Usually we prefer to propogate attributes based on name, even for
conversion between geometry types. Builtin attributes are a common
exception though. The Curve to Points node and the Curve to Mesh node
didn't correctly handle the "custom_normal" attribute, which shouldn't
be propagated. This has only been a problem since custom normals were
converted to a generic attribute on meshes in f9b627d29c.

Pull Request: https://projects.blender.org/blender/blender/pulls/136452
2025-03-25 15:09:35 +01:00