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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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.
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).
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
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
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
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
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
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
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
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
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
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
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
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
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.
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`).
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
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
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