Part of #134755 / #134766.
The asset browser currently lacks a compact view that leaves names
readable. Especially when managing asset libraries (e.g. to prepare it
for sharing or set up a production library), this is quite a usability
issue. A column view like the file browser has can solve this, allowing
a quick overview and fast browsing of libraries, while keeping names
readable.
Adds a new "Horizontal List" display mode to the asset browser that
distributes assets over multiple columns, with horizontal scrolling.
Asset previews are shown in this mode, plus an asset type icon if
there's enough space. The size of previews and the columns can be
configured next to the display mode, for optimizing the display.
Pull Request: https://projects.blender.org/blender/blender/pulls/135306
Hovering over UI items will pop up a tooltip hint if you are perfectly
still. This is easy when using a mouse since it is resting on a
surface. But with a tablet pen you are holding it off the surface so
absolute stillness is difficult. This PR allow a small amount of
movement. So unsteady or slow movement will still pop up the hint.
Pull Request: https://projects.blender.org/blender/blender/pulls/135602
Toolbar items with variations open a menu on long press. But they will
also open immediately on drag. The amount of distance it considers a
drag is about two pixels. Tablet pen users generally move more than
that while selecting items so the menu almost always pops out. This PR
uses the correct drag distance per pointer type, and uses the position
of the start of the drag instead of the last reported position.
Pull Request: https://projects.blender.org/blender/blender/pulls/135677
Using `UI_but_func_tooltip_custom_set()` to create a custom tooltip
would completely disable the quicker label tooltip, even when explicitly
set using `UI_but_func_tooltip_label_set()`. Instead the quick label
should show first, and then the full tooltip once the usual tooltip
timer is reached.
WM_report was originally added for special cases however new code
has been using this in operators for example, where reports should be
sent to the operator via BKE_report, so the caller can handle,
and so Python can catch the errors.
Rename the functions to make them less easily confused with BKE_report
and add a code-comment on why their use should be avoided.
Mouse and action zone interaction for scrollbars depend on `v2d->vert`
and `v2d->hor`, which are updated through `view2d_masks`. However,
scrollbar drawing through `UI_view2d_scrollers_draw` calls
`view2d_scrollers_calc`, which pads these sizes further, meaning that
drawn scrollbars are slightly out of sync with their hotspots. This is
noticeable at track edges for shrinking scrollers or when tracks are
opaque. Fix by moving the extra (noticeable) padding code from
`view2d_scrollers_calc` to `view2d_masks`.
Pull Request: https://projects.blender.org/blender/blender/pulls/135021
We are showing full paths to the library file on some tooltips, like
for brush assets. This PR checks to see if the asset is in the
BLENDER_SYSTEM_DATAFILES/assets folder. If so it just shows it as
"Built-in Asset:" and with the last portion of the path.
Pull Request: https://projects.blender.org/blender/blender/pulls/135593
The curve widget in the redo popup would sent an undo push which it
shouldn't really. Since 1bde901bf2 such undo pushes will lead to
clearing of the last operation data, which is exactly what the redo
popup displays.
Buttons in operator redo UIs shouldn't send undo pushes. 179169d6c7
disabled them for the "Adjust Last Operation" panel, but not for this
redo popup. In fact there was other code to disable undo for these
buttons, but 2d2f23de10 put this into a wrongly scoped conditional
branch, so it was only executed on the first full redraw.
We can revert 179169d6c7 too now (confirmed already), but I'll do that
separately and not in the release branch.
Confirmed that the following related issues are all (still) fixed with
this:
- #55348
- #134505
- #135655
Pull Request: https://projects.blender.org/blender/blender/pulls/135730
Caused by 21aef81714
Now, pass along `uiname` as `std::optional<StringRef>` early on (and use
`std::nullopt`).
Without this, the `(!uiname || !uiname->is_empty())` condition in
`ui_item_enum_expand_elem_exec` wont be true, resulting in the empty
label.
Pull Request: https://projects.blender.org/blender/blender/pulls/135621
The general idea is to keep the 'old', C-style MEM_callocN signature, and slowly
replace most of its usages with the new, C++-style type-safer template version.
* `MEM_cnew<T>` allocation version is renamed to `MEM_callocN<T>`.
* `MEM_cnew_array<T>` allocation version is renamed to `MEM_calloc_arrayN<T>`.
* `MEM_cnew<T>` duplicate version is renamed to `MEM_dupallocN<T>`.
Similar templates type-safe version of `MEM_mallocN` will be added soon
as well.
Following discussions in !134452.
NOTE: For now static type checking in `MEM_callocN` and related are slightly
different for Windows MSVC. This compiler seems to consider structs using the
`DNA_DEFINE_CXX_METHODS` macro as non-trivial (likely because their default
copy constructors are deleted). So using checks on trivially
constructible/destructible instead on this compiler/system.
Pull Request: https://projects.blender.org/blender/blender/pulls/134771
Previously, when pressing the Backspace key inside an open color picker,
the HSV and Hex field components would not refresh. Only the RGB
components would.
Fixed by calling the attached button function callbacks which propagates
the color changes to the other color picker buttons from the RGB values.
Pull Request: https://projects.blender.org/blender/blender/pulls/135131
In any Action Slot selector, when there is no slot selected yet, replace
the 'Duplicate' and 'Unassign' buttons with a large 'New' button. This
is consistent with the ID selector, which does the same thing.
Care is taken to ensure this is only applied to the use case of
selecting Action Slots, in order to minimize the UI changes in Blender
4.4.
The only other use case of `template_search()` that I could find, is the
View Layer selector in the top-right corner of the window. However, even
without the "_is this an Action Slot selector_" guard, it would not show
these changes, as Blender guarantees there is always a view layer
assigned. Add-ons may still use `template_search()` in other ways,
though, so it's still good to keep this guard in place.
Pull Request: https://projects.blender.org/blender/blender/pulls/135443
Rather than continuing to use ICON_TEMP, meant to represent temporary
locations, this PR adds a specific one - ICON_PREVIEW_LOADING - for
this purpose. Just a copy of ICON_TEMP for now, but with all parts at
40% opacity, matching how we use it now. Not only gives us an icon we
can later change, but also removes our special handling of reducing
opacity for one icon id.
Pull Request: https://projects.blender.org/blender/blender/pulls/135463
Adds the option to create a boolean socket that can be used as a panel toggle.
This allows creating simpler and more compact node group UIs when a panel
can be "disabled".
The toggle input is a normal input socket that is just drawn a bit differently in
the UI. Whether a boolean is a toggle input or not does not affect evaluation.
Also see #133936 for guides on how to add and remove panel toggles.
Pull Request: https://projects.blender.org/blender/blender/pulls/133936
Noticed while working on #134814 that `BLF_width_to_rstrlen()` would
give one character too much to put into the available space, resulting
in a visual overflow or clipped text when BLF clipping is enabled.
I think the issue was hidden by the code from 9c09998530, which would
remove further characters until the string actually fits. I'm proposing
to disable that code for now, hoping that this properly fixes the issue.
`BLF_width_to_rstrlen()`/`blf_font_width_to_rstrlen()` are supposed to
find the largest part from the end of a string that fits into a given
width. It would iterate the string from the back until a character
doesn't fit into the width anymore. However, it would return the
index of that character, the one that doesn't fit anymore, instead of
the last character known to fit.
Pull Request: https://projects.blender.org/blender/blender/pulls/135239
This changes the drawing in the tree interface panel so that panels always show
the icon to collapse it, even if it is empty. This makes it more obvious when an
item is a panel and not just a socket.
Right now, this is not strictly necessary, because sockets can also be
identified by their socket icon. However, that changes with #133936 where a
panel can also have a (boolean) socket.
Pull Request: https://projects.blender.org/blender/blender/pulls/135207
For MacOS, when hovering your mouse over the area corner "action zones"
the Status Bar shows a "Swap Areas" item that has unnecessary spacing
between the Control modifier key icon and left mouse button icon. This
is because I forget different icons were shown for Mac. This PR just
uses the proper calculated spacing that knows better.
Pull Request: https://projects.blender.org/blender/blender/pulls/135208
This patch registers scrollbars with handles so that they shrink just
like their non-handle counterparts.
To avoid user errors related to clicking into the handle track instead
of the underlying view, if the final alpha of the track is invisible (0)
then it will range up to 0.25 instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/135023
Remove GP legacy obtype and unused functions
Few hidden bugs are fixed with that:
- Outliner drag-drop for GP material/effect elements now works
- Correct stats are shown in status bar.
Pull Request: https://projects.blender.org/blender/blender/pulls/133957
Our UI code is currently showing the text "inf" when a numerical input
contains _exactly_ the value of FLT_MAX. But this is the max value for
doubles and we enforce a maximum float precision of 6 digits. This
means that a property can start with "inf" by default but it is
impossible edit, or even keep the same value, by editing in the UI
and show as "inf". This PR defines values that are the actual minimum
and maximums currently usable in the UI and values greater than or
equal to are shown as "inf" (equivalent for "-inf").
Pull Request: https://projects.blender.org/blender/blender/pulls/131876
Move the code dealing with converting float3 to GPU normals
out of the vertex format header into a separate header. Use a
proper C++ namespace and remove duplication by only using
the more recently added C++ templated conversions.
Most of the diff comes from the removal of the indirect includes
from GPU_vertex_format.hh. A lot of files ended up mistakenly
depending on that.
Pull Request: https://projects.blender.org/blender/blender/pulls/134873
Was reported for alt-editing, thats the same code though.
Previously ( da1038c768 ), the check for "matching" nodes was based on
the `legacy_type`.
This does not uniquely identify a node type, only the `idname` does.
By "matching", I mean having the same properties (so later setting
values can happen on all selected nodes).
If we allow "non-matching" nodes into our list in
`UI_context_copy_to_selected_list`, setting values on non-existent
properties later can act up (throwing `AttributeError` , also
`RNA_property_boolean_set` would actually try to create an equally named
IDP).
Better to exclude these as soon as possible, now remove nodes from
"selected_nodes" based on the `idname` (rather than `legacy_type`), this
way we can be sure properties match.
Pull Request: https://projects.blender.org/blender/blender/pulls/134930