Commit Graph

120055 Commits

Author SHA1 Message Date
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
Philipp Oeser
a062b334a9 Fix #136491: crash 'Select Linked' after 'Select Boundary Loop'
...  when in multiobject editmode

We had a similar issue in #95752, so the fix here is similar to
cc0c4c17f0

The reason here is that `edbm_region_to_loop_exec` switches to edge
select mode but was only doing this on objects that actually had faces
selected, all other participating meshes would keep their selectmode
which would now be out of sync with both the objects that had faces
selected and scene settings for these.

This causes problems later in 'Select Linked'. Here, a mixture of
objects are used. First the viewcontext is set up with the active
object, then all participating objects are iterated (changing the
viewcontext to another object), then `unified_findnearest` would use
that changed viewcontext which would now contain the last object
iterated. To repeat: this could now have a different selectmode than the
active object which is later **again** used to get the nearest `BMElem`
from in `EDBM_elem_from_selectmode`. So in the failing case, we could
get an edge (but no face because of edge selectmode) from
`unified_findnearest`, `EDBM_elem_from_selectmode` would return NULL
though (edge provided, but in face selectmode), leading to the crash.

To solve this it is best to change selectmode on all
participating meshes in multi-object editmode if necessary so
these are always in sync for following operations.

Pull Request: https://projects.blender.org/blender/blender/pulls/136497
2025-03-25 13:54:01 +01:00
Jacques Lucke
6eac902c90 Fix #136131: crash calling valid_socket_type on custom node trees
This was likely introduced when `socket_type->idname` was changed
from `char[]` to `std::string`.
2025-03-25 13:38:14 +01:00
Habib Gahbiche
d3431f2d33 Fix #136293: Improve description for Crop Node
Pull Request: https://projects.blender.org/blender/blender/pulls/136442
2025-03-25 13:03:21 +01:00
Jeroen Bakker
3c13d14e83 Cleanup: Remove incorrect CPP attribute
Parameter was tagged to be deprecated, but in fact it is not.
2025-03-25 12:47:28 +01:00
Jacques Lucke
fb932e7a52 Fix #136175: material set from Geometry Nodes not showing in edit mode
The special case for `edit_mesh` is still necessary to avoid introducing
the issue from #133698.
2025-03-25 12:14:44 +01:00
Omar Emara
7bdf900296 Fix #136295: Cryptomatte node fails for image sequences
The Cryptomatte node fails for image sequences in some cases. This is
due to a use after free error which might even crash in some cases. This
is because the loop that computes the image Cryptomatte layers calls the
cached images container to get the passes, which might free the render
layers structure that is used while looping.

To fix this, gather the render pass names first then retrieve all the
images at once.
2025-03-25 12:58:06 +02:00
Sybren A. Stüvel
6ffb0e368d Fix #136388: Move slots to new action not maintaining animation data
When moving slots (with all their associated animation data) from one
Action to another, tag the data-blocks that are affected by the slot
move, so that they get re-evaluated. Without this, their (out of date)
evaluated copy would still point to the original Action, which no longer
has animation data for the moved slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/136454
2025-03-25 11:44:48 +01:00
Sybren A. Stüvel
a7d787f5b9 Fix #136347: Keyframe interpolation behavior changed for BoolProperty
F-Curve interpolation uses the `FCURVE_INT_VALUES` and
`FCURVE_DISCRETE_VALUES` flags, which were not set in the keyframe
insertion function for slotted Actions. This is now resolved by making
the RNA property type part of the `FCurveDescriptor`.

Existing code has been refactored a bit, mostly to allow calling
`update_autoflags_fcurve_direct()` with just the RNA property type,
instead of passing the property itself. This avoided the need to include
pointers to RNA properties in `FCurveDescriptor`, which I think is a
slightly nicer design. It also makes it more explicit which aspect of
the property is used.

Because there's now another `std::optional<>` in the `FCurveDescriptor`,
I've also changed some `std::nullopt` to `{}` for brevity of the code,
as repeating that another time would have caused longer lines with more
rewrapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/136446
2025-03-25 10:34:19 +01:00
Sybren A. Stüvel
a3fde92b54 Refactor: Replace WM_global_report() with BKE_report() in anim code
In the animation & armature editors, replace calls to
`WM_global_report()` with `BKE_report`, to ensure that the reports go to
the appropriate report list (and giving callers control over this).

There's one `WM_global_report()` call left, in
`ED_armature_bone_rename()`. That doesn't have a `ReportList` available,
so I left it as-is for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/136261
2025-03-25 10:31:46 +01:00
Pratik Borhade
8eb2a9ef02 Fix #136415: Regression: Color management settings can't be animated
Caused by 9855c11d2c
Pass correct values when scene idtype exists, otherwise
`RNA_path_from_ID_to_property` won't return valid path

Pull Request: https://projects.blender.org/blender/blender/pulls/136423
2025-03-25 10:15:59 +01:00
Philipp Oeser
caf8951a0c Fix #136317: Mantaflow moving Collision not detected
Caused by 024d7d12e2

To resolve ( similar to d0a89a0950 ), add missing dirty tagging for
the positions.

Pull Request: https://projects.blender.org/blender/blender/pulls/136443
2025-03-25 10:08:55 +01:00
Omar Emara
79743b68a8 UI: Use a red alert theme color for unsupported nodes
Undefined nodes are currently drawn using a red alert theme color to
make it easier to spot them and replace them. On the other hand, nodes
that are unsupported, that is, nodes whose poll method fail, are not
reported to the user in any way. So this patch also uses the same red
alert color for unsupported nodes.

The node_type_is_undefined function is moved to the draw file since it
seems to be specific to it and not used anywhere else.

Pull Request: https://projects.blender.org/blender/blender/pulls/136451
2025-03-25 09:25:17 +01:00
Omar Emara
577c46c081 Fix #136360: Crash in older versions for files from v4.5
Blender crashes in older versions when loading files saved from v4.5 and
contain nodes like Mix in the compositor. That's because those nodes do
not exist in older versions, that is, this is a forward compatibility
issue.

The compositor already has protections in place to not crash when
loading files from future versions containing new nodes. However, for
nodes like Mix which existed in other node trees, the node is not new,
it is just new to the compositor, so it goes undetected and the
compositor tries to execute it leading to a crash.

To fix this, we also check the poll method of the node when verifying
compositor node trees. This should be backported to the corrective
release, as well as LTSs. But for v4.5, a change will later follow to
make the compositor execute such undefined/unsupported nodes using a
default operation that initializes the output with default values.

Pull Request: https://projects.blender.org/blender/blender/pulls/136438
2025-03-25 09:15:04 +01:00
Lukas Tönne
93576e5832 Fix #136327: Deleting group node crashes when there are multiple outputs
The group output node is updated as part of the topology cache.
When there are multiple group output nodes the first one with an "active"
flag is picked. However, if no group output is flagged this will leave
the group output unchanged in the cache, even if that node has been deleted.

Always initialize the group output runtime cache to null to avoid invalid
pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/136436
2025-03-25 08:23:52 +01:00
Campbell Barton
e87827834b WM: print the NDOF progress identifier instead of a number
Gives more useful output when debugging events.
2025-03-25 13:36:33 +11:00
Campbell Barton
486bd6dd60 Cleanup: simplify wmEvent::modifier checks
Check on the modifier flag were explicitly masking all modifiers
which isn't needed as this flag is ensured to only have the four
expected modifier flags set.

Simplify logic by removing masking for "all" modifiers.
2025-03-25 13:03:24 +11:00
Campbell Barton
2126758bd4 Fix: modifiers set to "Any" were shown as pressed in the key-map string
It's possible only some modifiers are set to "Any", these shouldn't
be considered pressed as the "Any" option is handled per modifier.
2025-03-25 12:36:09 +11:00
Campbell Barton
ec511316d2 Cleanup: minor changes to wmKeyMapItem modifier comparisons
Some of the existing logic checked that modifiers were KM_MOD_HELD,
other logic checked the value wasn't KM_NOTHING or KM_ANY.

Simplify checks by comparing against KM_MOD_HELD in all cases
as this won't be set to other values.
2025-03-25 12:14:27 +11:00
Campbell Barton
93bf29a851 Cleanup: correct values for wmKeyMapItem modifiers, use smaller types
- Document values to use for modifiers in code-comments.
- Only compare modifier values with KM_ANY/NOTHING/MOD_HELD.
- Use smaller integer sizes where possible.
2025-03-25 11:40:53 +11:00
Charles Flèche
ce70f99b5d Fix crash from a missing check for an environment variable on macOS
Ref: !136472
2025-03-25 11:07:47 +11:00
il4n
442150b5be Fix: VSE timeline and outliner out of sync
This fixes some certain cases, where the outliner wasn't notified of
changes in strip selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/136457
2025-03-24 20:49:22 +01:00
Harley Acheson
3e29f3eaa2 UI: Scroll Bars on the Left Side of Left-Aligned Regions
Toolbars and some other regions are aligned to the left sides of their
areas and have an (often hidden) right edge that can be dragged to
resize or hide it. If there isn't enough vertical space to show all of
its contents then you also get a scroll bar along that same edge. These
two things conflict badly and is almost impossible to use with a tablet
pen. The mouse cursor changes to indicate dragging over the scrollbar
but doesn't work. Dragging the scoll bar requires doing so to the right
of it. This PR moves the scroll bars to the left side of these left-
aligned areas. They are correctly changed to the right side if you flip
the region.

Pull Request: https://projects.blender.org/blender/blender/pulls/136218
2025-03-24 20:45:13 +01:00
Harley Acheson
daa417d304 UI: Increase Hit Size of the Close Region Action Zone
When regions are closed, like sidebars and toolbars, we show a little
arrow at the edge. This PR does not change that arrow, nor make any
noticable visual change, but almost doubles the hit size area. Much
easier to hit, especially with a tablet pen.  It also changes the mouse
cursor when hovering over it to ones that indicate movement in that one
direction, helping to reinforce that you are over the spot. Otherwise
the mouse cursor looks the same as when over the nearby edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/136334
2025-03-24 20:04:28 +01:00
Jacques Lucke
0f9ef0eefc Fix: Nodes: unavailable sockets are always unused 2025-03-24 19:36:46 +01:00