Commit Graph

46345 Commits

Author SHA1 Message Date
YimingWu
2ed21d7b90 Fix: Viewport: Assert when drawing fly navigation aim symbol.
The `immVertex2i` calls in `drawWalkPixel` will now cause an assert in
`immAttr2i` after 617858e453 because the component types are more
strictly enforced. Now switch to using floats to avoid asserts and
potentially drawing garbage in the viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/139429
2025-05-26 10:32:39 +02:00
Damien Picard
ba45498955 I18n: Use context for node panel translation in material properties
This is a follow-up to 9ce0a2d1d5 and uses the same logic. It allows
translation of node panel labels inside the material properties, using
their specified translation context. Not in use currently, but may be
needed in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/139367
2025-05-26 09:36:04 +02:00
Habib Gahbiche
8485d8a33c Compositor: Rename default node tree to "Compositing Node Tree"
Currently only visible in the tree path, but will be more noticeable
when node trees are not embedded anymore (outline and node editor).

Pull Request: https://projects.blender.org/blender/blender/pulls/139358
2025-05-26 08:24:56 +02:00
Jacques Lucke
024f8a9595 Fix #139388: Nodes: Frame node with text has wrong margins and line breaks
This was caused by an oversight in ae5b83e4ef.
It first removed the `aspect` and then brought it back later on, but forgot
to use it in all cases.
2025-05-26 06:01:53 +02:00
Jacques Lucke
f66aa6529a Geometry Nodes: support panels and attribute/layer search in node group operator
Previously, the node group operator only had fairly basic flat drawing for the
inputs. Due to previous refactors, it's now possible to reuse the drawing code
of the Geometry Nodes modifier. That way the redo panel now has all the features
that also exist in the modifier. Also, future improvements will benefit both
systems and potentially more in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/139389
2025-05-26 05:44:59 +02:00
John Kiril Swenson
6bd750bc01 Fix (unreported): VSE: Strips not deselected on press
With #128051, the default timeline tool changed to
a `sequencer.select` on press with no associated
properties (before, it had `deselect_all`).

This meant that retiming key selection broke (as
reported in #129892) and strips would only deselect
on release if clicking into empty space (due to a separate
keymap item in the global sequencer keymap).

This patch reverts 97e44901b4 while keeping its fix,
in favor of a more robust solution (just add `deselect_all`
to the keymap item properties in the box select tool).
2025-05-25 16:22:16 -05:00
Jacques Lucke
d35351fdc8 Fix #139364: FileHandler example for shader editor does not work 2025-05-24 18:46:42 +02:00
Guillermo Venegas
eed8e10b91 Refactor: UI: Remove uiItemIntO API
This function has not python equivalent, using the
returned pointer to write properties seems enough
as equivalent as how is done in python.

Also, this removes the unused `uiItemFloatO` API.

Pull Request: https://projects.blender.org/blender/blender/pulls/139355
2025-05-24 16:15:51 +02:00
Hans Goudey
9ffb474e07 Fix #139330: Incorrect offset grouping nodes inside frame
Similar to c52da69dfb
2025-05-24 09:17:39 -04:00
Jacques Lucke
680e53fcee Cleanup: Geometry Nodes: rename GeoModifierLog to GeoNodesLog
Nowadays, Geometry Nodes is not only evaluated by a modifier, but also by an
operator and in the future potentially by brushes. Therefore, the old name was
misleading because it sounded like it was specific to the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/139378
2025-05-24 10:39:36 +02:00
Jacques Lucke
70ce733b8c Refactor: Nodes: add general NodeComputeContext
This is used as base class for the compute contexts for group and evaluate
closure nodes. Furthermore, in the future this can be used for the compute
context that is passed into field evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/139377
2025-05-24 10:39:24 +02:00
Hans Goudey
8fdf37cd50 Fix #139114: Node insert auto offset broken with frames
Caused by 4bf34d9591.

Quite a bit of complexity used to avoid moving both nodes and their
frame parents is redundant now, since all connected nodes should
be moved and moving frames doesn't also affect the nodes inside
anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/139306
2025-05-23 14:18:09 +02:00
Pratik Borhade
0ad79ca541 Fix #139170: Regression: The Linked Node Group Socket Name is Editable
This probably have occured after migration from UIList. When nodetree ID
is linked form another file, disable the layout for individual rows and
the add/remove operator. Also tweak `supports_renaming()` function so that
individual tree element cannot be renamed when linked.

Pull Request: https://projects.blender.org/blender/blender/pulls/139269
2025-05-23 12:19:41 +02:00
Pratik Borhade
23bddef11a Fix #139179: Shader node panels are not translated in the material properties
Missed in 613bb9771b. To fix translation of panel header, use `IFACE_` macro).

Pull Request: https://projects.blender.org/blender/blender/pulls/139262
2025-05-23 12:18:17 +02:00
Aras Pranckevicius
a4b76dbb09 IO: more strongly indicate that Collada is deprecated
- Add "(Deprecated)" to Collada I/O tooltips
- Move the import/export menu items to be the last ones from the
  built-in items

Pull Request: https://projects.blender.org/blender/blender/pulls/139303
2025-05-23 12:02:38 +02:00
Richard Antalik
c4eab49b9c Fix #135930: Strip can be added to locked or muted channel
When strip is added, operator first finds "best" channel to place a
strip in, then adds new strip to that channel and finally does check if
the strip is overlapping other strips. If it does, it handles the
overlap.

To prevent adding strip to locked or muted channel, fix has to be done
at 2 places:
 - `sequencer_generic_invoke_xy_guess_channel` which finds the "best"
channel
 - `transform_seqbase_shuffle_ex` which handles overlap.

Further check for free channels was added to all strip add operators.
If there is no space above channel, that user selected, error is
displayed and operator is cancelled.

Note, that `transform_seqbase_shuffle_ex` is used only for resolving
overlaps where strip position in time must stay constant, so it moves
the strips in Y axis. This PR does not affect user selectable
`overlap_mode`.

Pull Request: https://projects.blender.org/blender/blender/pulls/136016
2025-05-23 06:51:36 +02:00
Jacques Lucke
1307137f27 Nodes: clarify socket visibility methods
Node sockets have many different aspects that affect their visibility and
whether they are grayed out. This patch cleans up the methods used to check if
sockets are visible and adds descriptions that should make it more obvious which
ones should be used.

This also fixes a few places where the wrong method was used which is more
obvious now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139251
2025-05-23 06:10:03 +02:00
Jacques Lucke
0b24f15939 Spreadsheet: persistent table layouts
The main goal of this patch is that the column widths and ordering is not reset
every time one switches between different contexts.

It does that by keeping track of multiple `SpreadsheetTable`. There is one for
each table that is viewed (so e.g. the point and edge domain of the same mesh
are two different tables). Each table has an identifier and an array of columns.

There is some garbage collection in place so that the number of stored tables
does not increase unbounded.

This also comes with an updated Python API:
```python
import bpy
spreadsheet = bpy.context.screen.areas[...].spaces.active
active_table = spreadsheet.tables.active
print(active_table.id.type)
print(active_table.id.attribute_domain)
print(active_table.columns[0].id.name)
```

In the future, we might add some smarter logic to keep tables with different
identifiers more in sync. We don't have a great heuristic for that yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/139205
2025-05-23 06:07:04 +02:00
Campbell Barton
84694bf635 Cleanup: add inline array size comments and minor corrections 2025-05-23 14:03:20 +10:00
Guillermo Venegas
99e9b2522b Refactor: UI: Remove uiItemBooleanO API
This function has not python equivalent, using the
returned pointer to write properties seems enough,
equivalent to how it is done in Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/139295
2025-05-23 01:07:12 +02:00
Hans Goudey
cb77f6fd14 Cleanup: UI: Remove unused arguments for operator buttons 2025-05-22 16:26:46 -04:00
Sean Kim
93f743ec46 Cleanup: Avoid passing both SculptSession and Object
Reduces the number of parameters passed in `sculpt_undo.cc`,
additionally the `const` specifier is misleading here, as the
`SculptSession` is modified via the `Object` reference.

Pull Request: https://projects.blender.org/blender/blender/pulls/139252
2025-05-22 21:10:23 +02:00
Nicola
f1ab22465f Fix: Line stroke method is drawn incorrectly
Mistake in 7d97ba4c5f

Pull Request: https://projects.blender.org/blender/blender/pulls/139286
2025-05-22 21:04:35 +02:00
Sean Kim
e77d82401b Fix #139223: Topology automasking crash when precomputed
The topology automask setting uses the active vertex when precomputing
the cache at the beginning of a stroke. This value can be invalid when
the brush stroke doesn't start on the mesh.

For example, this can happen with brush strokes that use a projected
instead of spherical falloff due to more BVH nodes being included in the
initial coarse check.

To fix this, simply check for the existence of the active vertex and
early exit if it is not valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/139234
2025-05-22 20:32:23 +02:00
Guillermo Venegas
b3eb84f624 Refactor: UI: Remove uiLayout::op id properties parameter
This was an alternative way to write properties for layout operator buttons,
for the most cases are more than enough to use the returned pointer.

There were just 2 cases where this was useful, the quick access menu
that reuses operator property values, this now overrides the id property group
data pointer generated for the operator, also for `uiItemsFullEnumO_items`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139242
2025-05-22 20:19:18 +02:00
RedMser
85dcfe70bc Fix: File Browser: Hiding dot-prefixed data-blocks
When file browsing inside a blend file's contents, allow the optional
hiding or showing of data blocks that have names that start with dot.

Pull Request: https://projects.blender.org/blender/blender/pulls/138875
2025-05-22 19:46:59 +02:00
Miguel Pozo
e6638d6e5e Refactor: GPU: GPUMaterial & GPUPass compilation
Cleanup and simplification of GPUMaterial and GPUPass compilation.
See #133674 for details/goals.

- Remove the `draw_manage_shader` thread.
  Deferred compilation is now handled by the gpu::ShaderCompiler
  through the batch compilation API.
  Batch management is handled by the `GPUPassCache`.
- Simplify `GPUMaterial` status tracking so it just queries the
  `GPUPass` status.
- Split the `GPUPass` and the `GPUCodegen` code.
- Replaced the (broken) `GPU_material_recalc_flag_get` with the new
  `GPU_pass_compilation_timestamp`.
- Add the `GPU_pass_cache_wait_for_all` and
  `GPU_shader_batch_wait_for_all`, and remove the busy waits from
   EEVEE.
- Remove many unused functions, properties, includes...

Pull Request: https://projects.blender.org/blender/blender/pulls/135637
2025-05-22 17:53:22 +02:00
Campbell Barton
99a4c93081 Cleanup: inline array sizes in code-comments
Use a similar convention for struct member identifiers,
(the identifiers without surrounding spaces). This allows the values
to be scanned and validated.
2025-05-23 00:41:39 +10:00
Jacques Lucke
9ac3e44ce6 Spreadsheet: move context path to left side bar
Previously, we were drawing the context path in the header of the spreadsheet.
However, that had some problems:
* When using a viewer that's somewhere deep in a node group, the viewer path
  wouldn't fit.
* Standard editor menus didn't fit in. Also we wanted to add spreadsheet
  specific operators that should be in a new menu.
* Couldn't fit more useful data for the context path (like the inspection index
  for repeat zones).

This patch solves this by moving the entire context path to the left side bar.
This frees up the header for menus.

The new context panel information is added at the top of the side bar because
then there is a proper hierarchy: `Object > Evaluation State > Viewer Path
(optional) > Instance Selection > Domain Selection`

This patch also adds information about the current inspection index for for-each
and repeat zones. They are not editable yet, but that can be implemented
separately as it might require a few more changes for everything to update
correctly.

The new Viewer Path panel is only displayed when actually showing viewer data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138477
2025-05-22 15:04:41 +02:00
Philipp Oeser
1d0c11987f Fix: Scale/Rotate proportional editing for Grease Pencil / Curves
If the `transdata_check_local_islands` check does not succeed, we end up
with `CTX_NO_PET` for scaling/rotation.

For `Grease Pencil`, this was lost in the transition from GPv2 > GPv3
(type was renamed to "legacy", then removed from
`transdata_check_local_islands` in a804320138, but the new type was
never added).

Curves never specified support for this, but both types are (in theory)
taking into account `V3D_AROUND_LOCAL_ORIGINS` in
`curve_populate_trans_data_structs` (logic from 9d86fada03 might be a
bit broken for proportional editing "islands" without anything selected
as reported in #139101, but that will be corrected in another PR).

So to resolve, add `Grease Pencil` and `Curves` as supported object
types in `transdata_check_local_islands`

NOTE: `transdata_check_local_center` already has these two types as
well.

Part of #139101

Pull Request: https://projects.blender.org/blender/blender/pulls/139209
2025-05-22 13:38:22 +02:00
Habib Gahbiche
eb51e0a206 Compositor: gizmo for Split node
The gizmo is a line (implemented as a 2d cage gizmo) that can be
dragged accross the image vertically or horizontally.

Pull Request: https://projects.blender.org/blender/blender/pulls/139107
2025-05-22 11:19:09 +02:00
Habib Gahbiche
5e12caba08 Gizmo: Support translation without cross drawing
Add an enum entry `ED_GIZMO_CAGE_DRAW_FLAG_NOP` to be able to set enums
explicitly to draw no handles.
The current code already supports this case implicitly.

See https://projects.blender.org/blender/blender/pulls/139107 for an
example use case.

Pull Request: https://projects.blender.org/blender/blender/pulls/139210
2025-05-22 10:54:18 +02:00
Christoph Lendenfeld
87a28fa117 Anim: Common Playhead snapping for all editors
This patch adds snapping options for the playhead to all animation editors.
The options can be modified through a new dropdown in the editor header.

All editors will show all those options, and they are shared,
so toggling the option in on editor will change it for all other editors too.
Some options are not working/relevant in some editors for example
Strips in the Dope Sheet. However for consistency the option is still shown.
This is a separate menu from the transform snapping menu because
you can toggle the snapping for transform and playhead separately.
Putting it in the existing snapping transform menu would imply that it can
be turned off with the magnet which is not the case.

Playhead snapping is explicitly disabled for the drivers editor
because there is no playhead to drag around.

Snapping to Frame/Second intervals takes the scene start as a starting point.
That means you can snap to the n-th second of the animation even though
it might not start at frame 1. The preview range is NOT taken into account
by design since the use case is working on a sub-section of the animation
in which case the snap target should not change.

Snapping is toggled by pressing CTRL as indicated by the status bar.

Snapping to Frames/Seconds is absolute, meaning no matter
how far away your cursor it will snap to the closest snap point.
All others only snap to things if they are close to the cursor in pixel values.
When mixing those two behaviors, it prefers relative snapping.
If no point is close enough to snap relative,
it will fall back to absolute snapping.

Based on the prototype #135913
Part of #135794

Pull Request: https://projects.blender.org/blender/blender/pulls/137278
2025-05-22 10:17:19 +02:00
Jacques Lucke
45ee859c22 Cleanup: make format 2025-05-22 08:29:55 +02:00
Mukhesh
615eb54ef4 Fix: VSE Duplicating strips in preview operates on all strips
Deselect strips not intersecting current frame, when operator is
invoked from preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/139026
2025-05-22 07:34:14 +02:00
Sean Kim
f5276ac09e Cleanup: Rework sculpt_undo.cc for readability
* Avoid usage of `applied` in favor of helper methods to indicate
  undo and redo requirements
* Rename `bmesh_restore_begin` and `bmesh_restore_end` to avoid
  similarity with geometry methods
* Swap `geometry_original` and `geometry_modified` to match
  expected meaning

Pull Request: https://projects.blender.org/blender/blender/pulls/139244
2025-05-22 06:39:02 +02:00
Campbell Barton
dbf86f291c Cleanup: prefer term "unreliable" over "flaky"
Avoid slang terms, also correct typo.
2025-05-22 13:51:29 +10:00
Campbell Barton
9c421cbef2 Fix crash in grease pencil snap without a window region
Add window region check to the poll function.
2025-05-22 03:15:13 +00:00
Campbell Barton
991d48a9ed Fix crash in vertex group lock
Resolve discrepancy in the poll/exec functions active-object check.
Also use matching object access for the enum callback.
2025-05-22 13:05:49 +10:00
Jacques Lucke
5457cca3de Nodes: auto-hide unused inputs if usage depends on menu
Previously, when a socket was detected to be unused, it was just grayed out.
This patch adds support for automatically hiding unused sockets based on this
convention: Menu inputs control visibility while other inputs only control
whether something is grayed out.

More specifically, an input is visible if any of these conditions is met:
* It affects the output currently.
* It never affects the output. In this case its usage does not depend on any
  menu input.
* It is used if all non-menu inputs are considered to be unknown.

In the future, we could support customizing which inputs are allowed to control
visibility. For now it's good to use the convention that Blender generally
follows itself.

As before, panels are grayed out if they only contain grayed out sockets and
panels are hidden when they don't contain any visible sockets.

Hiding inputs works in group nodes, the Geometry Nodes modifier and node
operators. In theory it will work for all node tree types, but since only
Geometry Nodes supports the Menu Switch node currently, this patch currently
only makes a difference there.

The implementation reuses the existing `SocketUsageInferencer` with a different
sets of inputs. So no new core-inferencing logic was needed.

Design task: #132706.

Pull Request: https://projects.blender.org/blender/blender/pulls/138186
2025-05-22 04:48:43 +02:00
Campbell Barton
10876f3f4f Fix crash in Sequencer Unmute without a valid region
Regression in [0] using the contexts "region" without a null check.

[0] 541e2b3cdd
2025-05-22 02:37:29 +00:00
Campbell Barton
937d9853a4 Fix crash in keyframe jump when called without a valid area
Regression in [0] using the contexts "area" without a null check.

[0] 9663d287fc
2025-05-22 12:22:11 +10:00
Campbell Barton
2f6b89b174 Fix crash in attribute convert/remove
Regression in [0] caused the poll function to compare the result with
nullptr instead of std::nullopt.

The operators exec function then de-referenced the the std::nullopt.

[0]: 550094b018
2025-05-22 02:18:39 +00:00
Campbell Barton
e5deeafe92 Cleanup: spelling in comments (make check_spelling_*) 2025-05-22 11:11:48 +10:00
Campbell Barton
0bd62779e8 Cleanup: various non-functional changes for C++ 2025-05-22 01:01:08 +00:00
Julian Eisel
85150c7ba1 Fix: Asset browser glitch when library has back slash in path
When displaying an asset library that contains a back slash on macOS (or Linux,
I assume), resizing the asset browser would make all assets disappear, and
instead the message would show that indicates an invalid asset library path.
2025-05-21 21:06:08 +02:00
John Kiril Swenson
65f821139f VSE: Copy handles to selected strips
Now that handles are effectively hidden with the "Tweak Handles" option
(and clear themselves if `use_restore_handle_selection` is set),
handle selection for multiple strips is quite unintuitive.

It is expected that, after selecting a group of strips, the user will
be able to tweak all of their handles, even if they are not connected,
consistent with other NLEs.

This patch enables that behavior by propagating handle selection to
all selected strips if "Tweak Handles" is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/139075
2025-05-21 19:18:46 +02:00
John Kiril Swenson
50321bac99 Fix: VSE: Tweaking strip with selected handle
Originally, `element_already_selected` would always return `true`
as long as the user clicked on a strip that was already selected,
regardless of its handle selection state.

This led to unexpected behavior when trying to tweak a strip:
E.g. taking a strip, selecting its left handle, then trying to tweak
the strip itself would actually tweak the left handle unexpectedly, even
though the cursor would be far enough away that this does not make sense.
2025-05-21 19:18:41 +02:00
John Kiril Swenson
98090e0400 Cleanup: VSE: Add selection code documentation and const code
A lot of this is very messy and I keep running into
the same weird edge-cases, so hopefully more documentation
will help for the time being, until I can rework the entire
selection system in 5.0.
2025-05-21 19:18:41 +02:00
John Kiril Swenson
9a6350c4a0 Cleanup: VSE: Rename eStripHandle enums from SEQ_ to STRIP_
Rename from `SEQ_HANDLE_*` -> `STRIP_HANDLE_*`.
2025-05-21 19:18:41 +02:00