Commit Graph

5662 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Jacques Lucke
40177a8426 UI: Tree View: support drag&drop below last element
Previously, when reordering a tree view item to the end, one had to move it drop
it fairly precisely on the lower half of the last item in the list. This patch
makes it possible to just drop it below the last item too. The outliner has the
same functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/139025
2025-05-21 17:56:39 +02:00
Jacques Lucke
6e29616c49 UI: support scrolling over fully visible tree view
Currently, nothing happens when trying to scroll while hovering a tree view that
is fully visible (i.e. does not have a scroll bar). This patch makes it so that
the scroll event is passed through in this case so that one can scroll the
entire region even when hovering the tree view. If the tree view does have a
scrollbar, then the scroll-event is still captured by that even if scroll all
the way up/down already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138930
2025-05-21 17:18:12 +02:00
Habib Gahbiche
f6048a5e7b Compositor: UI: Visualize render size and domain size in image editor
Show render region as a bounding box with a passepartout option.
Additionally, a text info is shown at the upper left corner, similar to
the info text in 3d view, showing the render size and current image
size.

Devtalk thread:
https://devtalk.blender.org/t/compositor-ui-improvements/34186?u=izo

Pull Request: https://projects.blender.org/blender/blender/pulls/120471
2025-05-21 15:57:31 +02:00
Campbell Barton
8f1cd941ce UI: show an icon in the "slots" menu for
A small quality of life change to indicate which slots are used.

This only applies to the slots menu, the UI List could show these too
however this requires extending the RNA API.

Ref: !138651
2025-05-21 11:09:25 +10:00
Guillermo Venegas
5b82ee11df Refactor: UI: Replace uiItemFullO_ptr with class method uiLayout::op
This converts the public `uiItemFullO_ptr` function to an object
oriented API (an `uiLayout::op` overload), matching recents changes
in the API.

Changes include rearranging the `IDProperty *properties` parameter to be
the last parameter. Now is optional (but will be removed), also instead
of using a return parameter the function now returns the pointer to
write properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/139166
2025-05-21 02:55:04 +02:00
Guillermo Venegas
44160a0524 Refactor: UI: Replace uiItemFullO with class method uiLayout::op
This converts the public `uiItemFullO` function to an object oriented
API (an `uiLayout::op` overload), matching recents changes in the API.

Changes includes the removal of the paramether `IDProperty *properties`
that seems unused (all places just sets `nullptr`, can be added as last
argument with `nullptr` as default value though), and instead of using a
return paramether the function now returns the pointer to write properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/138961
2025-05-20 15:19:34 +02:00
Hans Goudey
6562033a4a Cleanup: Use StringRef for some UI string arguments
Instead of StringRefNull.

Pull Request: https://projects.blender.org/blender/blender/pulls/139095
2025-05-19 17:25:52 +02:00
Campbell Barton
b3dfde88f3 Cleanup: spelling in comments (check_spelling_* target)
Also uppercase acronyms: API, UTF & ASCII.
2025-05-17 10:17:37 +10:00
Philipp Oeser
d2ea328a6c Fix #138869: Select Colums on selected Keys fails in NLA tweakmode
Currently, `columnselect_action_keys` gets "raw" non-NLA-mapped keyframe
data via `ANIM_fcurve_keyframes_loop`  with the `bezt_to_cfraelem` callback,
so the list of `CfraElem` contains frames in "local" FCurve space.

Later, this would be (rightfully) NLA-unmapped to "local/strip" time, because
this is what `ANIM_editkeyframes_ok(BEZT_OK_FRAME)` expects, it also only
compares "raw" `BezTriple` data.

But this only makes sense if we would store "global/scene" frame data in
`CfraElem` `cfra` already.

This is what we now do, let `bezt_to_cfraelem` perform the NLATIME_CONVERT_MAP

Pull Request: https://projects.blender.org/blender/blender/pulls/138937
2025-05-16 17:21:42 +02:00
Christoph Lendenfeld
9c35656766 Refactor: Move bone functions to separate file and into namespace
No functional changes intended.

This moves the functions
* ANIM_bone_is_visible
* ANIM_bone_is_visible_ebone
* ANIM_bone_is_visible_pchan

into new files `ANIM_armature.hh`/`armature.cc`.
They were previously in `ANIM_bone_collections.hh` but don't
directly have anything to do with bone collections.

It also puts the functions into the `blender::animrig::` namespace
and removes the `ANIM_` prefix as is the standard for C++ files.

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/138833
2025-05-16 14:45:46 +02:00
Guillermo Venegas
89a3478e35 Refactor: UI: Replace uiItemMenuF and uiItemMenuFN with uiLayout methods
This converts the public `uiItemMenuF` and `uiItemMenuFN`
functions to an object oriented API (an `uiLayout::menu_fn`
and `uiLayout::menu_fn_argN_free` respectively), following
recent uiLayout changes.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138902
2025-05-15 21:26:49 +02:00
John Kiril Swenson
41781df1a6 Cleanup: VSE: Rename seq1 and seq2 references
This patch renames `seq1` and `seq2` to `input1` and `input2` in `Strip`
and `StripSelection` structs to consist with recent refactors in
#132179.  It also renames other instances of `seq1` and `seq2` (e.g.
local variables) to `strip1` and `strip2` instead.

There is only one small breaking change to the Python API with
`strips.new_effect()` taking in the new names now. There should be
no other functional changes involved.

Pull Request: https://projects.blender.org/blender/blender/pulls/138296
2025-05-15 05:01:39 +02:00
Guillermo Venegas
351fbff95b Refactor: UI: Replace uiItemM_ptr and uiItemM with uiLayout::menu
This converts the public `uiItemM_ptr` and `uiItemM` functions
to an object oriented API (an `uiLayout::menu` overloads),
matching the python API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138895
2025-05-14 23:22:56 +02:00
Jacques Lucke
c77b93f49d Nodes: use modifier's persistent UID in context and viewer path
Previously, the modifier name was used to identify it in a compute context or
viewer path. Using `ModifierData.persistent_uid` (which was only introduced
later) has two main benefits: * It is stable even when the modifier name
changes. * It's cheaper and easier to work with since it's just an integer
instead of a string.

Note: Pinned viewer nodes will need to be re-pinned after the change.

Pull Request: https://projects.blender.org/blender/blender/pulls/138864
2025-05-14 15:18:36 +02:00
Campbell Barton
2bc284975b Refactor: remove the do_history argument from UV selection functions
Storing the selection history complicated the selection functions,
especially for situations when functions were called indirectly &
multiple times.

Remove the argument in favor of explicit calls to store elements
in the selection history.

Needed to avoid even more complexity with UV sync-select: see #131642.
2025-05-14 11:48:42 +00:00
Campbell Barton
247d8183f8 Refactor: pass the select mode to EDBM_selectmode_set
Pass the new selection mode instead of setting the value in the
BMEditMesh, then calling set.

This makes it possible to compare with the current selection mode
(needed for UV sync select #131642).
2025-05-14 11:26:58 +10:00
Guillermo Venegas
3b1e123361 Refactor: UI: Replace uiItemS and uiItemS_ex with uiLayout::separator
This merges the public `uiItemS` and `uiItemS_ex` functions into an
object oriented API (`uiLayout::separator`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code
(or vice-versa), making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138826
2025-05-13 17:54:26 +02:00
Christoph Lendenfeld
9ee5196db7 Refactor: Remove PBONE_VISIBLE and EBONE_VISIBLE macros
No functional changes intended.

This just replaces all calls to `PBONE_VISIBLE` and `EBONE_VISIBLE`
with appropriate functions.
In the case of editbones it is just the function that the macro already contained.
For pose bones, a new function was added that mirrors what the macro had.

Using a function will make it easier to change how selection is queried in the future.

part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/138819
2025-05-13 15:51:12 +02:00
Harley Acheson
87dcf4907a UI: Add Hide to Properties NavBar Item Context Menu
Add an item to hide the NavBar to the Context Menu for the items on the
NavBar.

Pull Request: https://projects.blender.org/blender/blender/pulls/138786
2025-05-13 00:57:10 +02:00
Guillermo Venegas
a017a6cc54 Refactor: UI: Replace uiItemO with class method uiLayout::op
This converts the public `uiItemO` function to an object oriented
API (`uiLayout::op`).
Also this rearranges `idname` paramether, since this the only one
required, and to make format similar to `uiItemFullO`

Note: One of the benefits of moving from a public function to class
method is to reduce API usage difference between C++ and Python. In
Python this method is called `UILayout::operator`, however `operator`
is a reserved keyword in C++.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138776
2025-05-12 22:14:38 +02:00
Jacques Lucke
bf696320f6 UI: support detecting good width for searchbox
Sometimes, the default size of the search box is not wide enough for the items
it shows. Currently, we sometimes hardcode an extra width factor and rely on
automatic name shortening with `...`. Both options are not ideal because they
are either often too wide or are hard to read with shortened names.

This patch implements an alternative solution. It adds a new function that
computes a good width for the search box based on its content. A certain minimum
and maximum width are still enforced.

Right now, this feature is only used in the Ctrl+F search in node editors, but I
guess it makes sense in most search boxes.

This also fixes #138641. While it's nice to have ways to use shorter search
terms, the search box should generally be able to deal with long items too.

Pull Request: https://projects.blender.org/blender/blender/pulls/138653
2025-05-10 04:48:30 +02:00
Jacques Lucke
1e23f9235c Nodes: highlight frame that nodes will be attached to
Previously, it was somewhat difficult to know if a dragged node will be attached
to a frame or not. This patch highlights the frame that dragged nodes will be
attached to which removes the guesswork. This is similar to how we highlight the
link that a dragged node will be inserted onto.

Pull Request: https://projects.blender.org/blender/blender/pulls/138648
2025-05-10 04:44:23 +02:00
Guillermo Venegas
858abf43c3 Refactor: UI: Replace uiItemFullR with class method uiLayout::prop
This converts the public `uiItemFullR` function to an object oriented
API (an overload of `uiLayout::prop`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138683
2025-05-10 03:39:31 +02:00
Jacques Lucke
4acd6d46d4 UI: rename Tooltip Label to Quick Tooltip
Change the mentions of "tooltip label" to "quick tooltip" to make this feature more
universally useful. The new name was suggested in #138583.

Pull Request: https://projects.blender.org/blender/blender/pulls/138639
2025-05-09 13:34:35 +02:00
Guillermo Venegas
dafdced6ab Refactor: UI: Replace uiItemR with class method uiLayout::prop
This converts the public `uiItemR` function to an object oriented
API (`uiLayout::prop`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138617
2025-05-08 20:45:37 +02:00
Guillermo Venegas
e5dcd0de99 Refactor: UI: Replace uiItemL with class method uiLayout::label
This converts the public `uiItemL` function to an object oriented
API (`uiLayout::label`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138608
2025-05-08 17:21:08 +02:00
Campbell Barton
63cdb7eae4 Cleanup: pass SelectPick_Params by reference instead of pointer
Also use a return value from ED_select_pick_params_from_operator.
2025-05-08 13:50:14 +10:00
Harley Acheson
48403607dd UI: Status Bar Event Icons for Trackpad Gestures
Adding three icons to represent panning, rotate, and zoom gestures
and using them for status bar event icons for
GHOST_kTrackpadEventScroll, GHOST_kTrackpadEventRotate, and
GHOST_kTrackpadEventMagnify.

Pull Request: https://projects.blender.org/blender/blender/pulls/138569
2025-05-07 23:57:03 +02:00
Guillermo Venegas
a76753ca55 Refactor: UI: Replace uiLayoutRadial with class method uiLayout::menu_pie
This converts the public `uiLayoutRadial` function to an object oriented
API (`uiLayout::menu_pie`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

`uiLayout::menu_pie` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138563
2025-05-07 23:29:49 +02:00
Guillermo Venegas
0a6211a974 Refactor: UI: Replace uiLayoutListBox and uiLayoutOverlap with methods
This converts the public `uiLayoutListBox ` and `uiLayoutOverlap `
functions to an object oriented API (an `uiLayout::list_box` and
`uiLayout::overlap` respectively), following recent uiLayout changes.

Both functions now returns an uiLayout reference instead of a pointer.
New calls to this method should use references too.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138559
2025-05-07 20:38:40 +02:00
Guillermo Venegas
a46e3d2e78 Refactor: UI: Replace uiLayoutAbsolute and uiLayoutAbsoluteBlock with uiLayout class methods
This converts the public `uiLayoutAbsolute ` and `uiLayoutAbsoluteBlock`
functions to an object oriented API (an `uiLayout::absolute` and
`uiLayout::absolute_block` respectively), following recent changes.

`uiLayout::absolute` now returns an uiLayout reference instead of a
pointer. New calls to this method should use references too.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138546
2025-05-07 17:03:15 +02:00
Sergey Sharybin
ee9b5532bd Cleanup: Const-correctness in various sequencer utilities 2025-05-07 16:21:06 +02:00
Sergey Sharybin
24a28ea38d Cleanup: Const-correctness in ImBuf metadata drawing 2025-05-07 16:21:06 +02:00
Sergey Sharybin
d7aa98d07f Sequencer: Remove backdrop drawing in timeline
It always was functionality which got committed without proper review
by the module or UI/UX team. It has all sort of UX problems, but it is
also something that will be tricky to support for HDR drawing.

To brings things to a more manageable state the functionality is now
removed.
2025-05-07 16:21:06 +02:00
Campbell Barton
8cc63c6848 Refactor: add a version of EDBM_selectmode_set_multi that takes objects
Support setting the select mode when the object array has already
been created, needed for #131642.
2025-05-07 17:03:29 +10:00
Campbell Barton
a1efa167aa Cleanup: replace inline viewport dist calculation with a function
While the function `ED_view3d_dist_range_get` was meant to calculate
the range for `RegionView3D::dist` the minimum value was often clamped
by the clip-start instead.

Move this into a function and improve doc-strings in this area
to clarify the conventions viewport zoom is expected to follow.

- Rename `ED_view3d_dist_range_get` to `ED_view3d_dist_soft_range_get`
  since it's not an error when the `dist` is outside this range.
- Return `Bounds<float>` instead of taking a return argument.
- Take a `use_persp_range` argument to avoid re-assigning
  the minimum in some cases.
- Add `ED_view3d_dist_soft_min_get` since it's common for
  only the minimum to be used (replace inline `v3d->clip_start * 1.5f`).
2025-05-07 01:15:22 +00:00
Guillermo Venegas
b83fe22703 Refactor: UI: Replace uiLayoutPanelPropWithBoolHeader with class method
This converts the public uiLayoutPanelPropWithBoolHeader function to an
object oriented API (`uiLayout::panel_prop_with_bool_header`), following
similar changes to the uiLayout API.

Pull Request: https://projects.blender.org/blender/blender/pulls/138523
2025-05-07 02:55:25 +02:00
Leon Schittek
d66b171996 Fix #112402: Improve search menu layout
Several small improvements to the layout of the search menu:
* Avoid the separator arrow on highlighted items being cutoff
* Properly center and prevent overlap of the scroll indicator
  arrows at the top and bottom
* Improve robustness with different zoom levels
* Overall more unified spacing and margins
This patch was originally authored by Yevgeny Makarov (@jenkm).

Pull Request: https://projects.blender.org/blender/blender/pulls/112422
2025-05-07 02:32:13 +02:00
Harley Acheson
022c85fec3 UI: Consistent File/Asset Drag Size
The size of preview images while dragging from File or Asset Browser is
currently related to the size that they are shown in the thumbnail
lists, sort of, but also based on the column size and with an incorrect
scaling. This PR just makes them a consistent size while dragging,
regardless of their thumbnail size.

Pull Request: https://projects.blender.org/blender/blender/pulls/138350
2025-05-06 22:35:26 +02:00