Commit Graph

8246 Commits

Author SHA1 Message Date
Pratik Borhade
72a38aee7e UI: Increase default rows of tree view
Tree view UI of bone collection, node interface and light linking is
quite small right now. Bump the minimum row count similar to
6d8e642367

Pull Request: https://projects.blender.org/blender/blender/pulls/135426
2025-03-16 06:44:36 +01:00
Harley Acheson
18d82c5164 Fix #135970: Allow Allow Movement After Tooltip Timer Starts
We can only allow some mouse and pen movement once the tooltip timer
has started. Doing so beforehand can keep some tooltips from starting.

Pull Request: https://projects.blender.org/blender/blender/pulls/135997
2025-03-14 19:16:43 +01:00
Julian Eisel
4499fad40e UI: Horizontal list view for asset browser
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
2025-03-14 16:43:12 +01:00
Harley Acheson
edf2706f8c UI: Improve Usage of Tooltips for Pen Users
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
2025-03-13 23:35:40 +01:00
Harley Acheson
8c5393d4c0 Fix #94324: Longer Drag Threshold for Pens on Tool Icons
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
2025-03-13 23:10:47 +01:00
Guillermo Venegas
4245f1320e Fix #135742: Avoid unespecified font style for side panel categories text draw
Apply widget style to avoid drawing with the incorrect text size or
weight for side panel categories.

Pull Request: https://projects.blender.org/blender/blender/pulls/135824
2025-03-13 21:44:23 +01:00
Campbell Barton
6ef7dae8ef Cleanup: spelling in comments (make check_spelling_*) 2025-03-13 13:41:17 +11:00
Julian Eisel
83924ff663 Fix: UI: Quick tooltip label overridden by custom tooltip function
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.
2025-03-11 15:56:35 +01:00
Sebastian Parborg
ec29eb6580 Refactor: Make it more obvious that wm_event_add is not a static function
By renaming it to WM_ follow the other public functions.
2025-03-11 14:39:18 +01:00
Campbell Barton
bd06baf6e6 WM: rename WM_report* to WM_global_report*, note it's often bad practice
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.
2025-03-11 12:36:17 +11:00
Harley Acheson
1a6eb39fed Merge branch 'blender-v4.4-release' 2025-03-10 17:11:59 -07:00
John Kiril Swenson
d8f3f8cc61 Fix: UI: Improve scrollbar hotspot region
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
2025-03-11 01:10:48 +01:00
Harley Acheson
b28a75d7ac Merge branch 'blender-v4.4-release' 2025-03-10 14:23:31 -07:00
Harley Acheson
d29f631b18 Refactor: Avoid Copying with Std::String in #135593
Commit 5ea6ffef68 used std::string in cases where StringRef or
StringRefNull could be used instead. This PR just changes those uses,
and therefore avoids some unnecessary string copying.

Pull Request: https://projects.blender.org/blender/blender/pulls/135756
2025-03-10 22:22:30 +01:00
Harley Acheson
8ded9a8350 Merge branch 'blender-v4.4-release' 2025-03-10 12:29:11 -07:00
Harley Acheson
5ea6ffef68 Fix #135134: Do Not Show Full Path to Built-In Assets
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
2025-03-10 20:28:00 +01:00
Julian Eisel
674c315182 Merge branch 'blender-v4.4-release' 2025-03-10 12:58:34 +01:00
Julian Eisel
df4345dbaa Fix #135655: Crash when setting Interpolate Sequences curve
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
2025-03-10 12:43:43 +01:00
Philipp Oeser
711772de88 Merge branch 'blender-v4.4-release' 2025-03-07 17:59:33 +01:00
Philipp Oeser
a568890515 Fix #135601: prop_tabs_enum No Longer Displays Text of Enum
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
2025-03-07 17:53:54 +01:00
Campbell Barton
d951428422 Cleanup: spelling in comments
Address warnings from check_spelling.py
2025-03-06 10:49:51 +11:00
Campbell Barton
5b856ba447 Merge branch 'blender-v4.4-release' 2025-03-06 10:35:59 +11:00
Campbell Barton
b85fc32cae Cleanup: spelling & repeated words in comments
Address warnings from check_spelling.py
2025-03-06 10:33:21 +11:00
Bastien Montagne
dd168a35c5 Refactor: Replace MEM_cnew with a type-aware template version of MEM_callocN.
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
2025-03-05 16:35:09 +01:00
Sybren A. Stüvel
d620f7605c Merge remote-tracking branch 'origin/blender-v4.4-release'
ch.cc
2025-03-05 13:28:16 +01:00
Jonas Holzman
32f8863b0c Fix #134260: Color Picker components partially resetting when pressing Backspace
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
2025-03-05 12:41:32 +01:00
Sybren A. Stüvel
a03077c22d UI: show '+ New' button in Action Slot selector when no slot is selected
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
2025-03-05 12:20:11 +01:00
илья _
02281dd26a Cleanup: BKE: Nodes: improve node label functions
Slight cleanup of function naming, return types and related things like early return.

Pull Request: https://projects.blender.org/blender/blender/pulls/135351
2025-03-05 11:17:50 +01:00
Pratik Borhade
c2a5fb28d7 Fix #135344: Extra space in node editor group panel
Remove extra padding from panel when it doesn't have toggle socket. It
was added in 2822777f13

Pull Request: https://projects.blender.org/blender/blender/pulls/135424
2025-03-05 11:16:56 +01:00
Harley Acheson
0ee642611c UI: Add Specific Icon to Represent Preview While Loading
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
2025-03-04 23:35:30 +01:00
Hans Goudey
c560cdc8cc Cleanup: Use StringRef for layout panel API functions 2025-03-04 14:29:15 -05:00
Harley Acheson
84123446e3 Fix #135324: Data-block selector icon drawn too big
DPI scaling was applied twice. Added an API comment to make this more
clear for the caller of the function. This is exactly the changes to
main committed in 47bbf3fcae, which is a
correction to 1f88645728.

Pull Request: https://projects.blender.org/blender/blender/pulls/135411
2025-03-04 18:11:00 +01:00
Harley Acheson
a021176ff4 UI: Show "Not Found" Icon when Not Found
In the unlikely event that an icon is requested that is not found, show
a specific icon that is meant to indicate this state, in "Error" color.

Pull Request: https://projects.blender.org/blender/blender/pulls/134959
2025-03-03 22:25:42 +01:00
Aras Pranckevicius
cc2c6692c0 Cleanup: Name more IMB things as "byte" or "float" instead of "rect" and "rectFloat"
- IB_rect -> IB_byte_data
- IB_rectfloat -> IB_float_data
- Rename some functions:
	- IMB_get_rect_len -> IMB_get_pixel_count
	- IMB_rect_from_float -> IMB_byte_from_float
	- IMB_float_from_rect_ex -> IMB_float_from_byte_ex
	- IMB_float_from_rect -> IMB_float_from_byte
	- imb_addrectImBuf -> IMB_alloc_byte_pixels
	- imb_freerectImBuf -> IMB_free_byte_pixels
	- imb_addrectfloatImBuf -> IMB_alloc_float_pixels
	- imb_freerectfloatImBuf -> IMB_free_float_pixels
	- imb_freemipmapImBuf -> IMB_free_mipmaps
	- imb_freerectImbuf_all -> IMB_free_all_data
- Remove IB_multiview (not used at all)
- Remove obsolete "module" comments in public IMB headers

Pull Request: https://projects.blender.org/blender/blender/pulls/135348
2025-03-03 17:11:45 +01:00
Jacques Lucke
53d8390c1b Cleanup: remove redundant layout panel function
While using the other function is a little more verbose, it's also more
explicit and having two functions this similar is confusing.
2025-02-28 19:33:07 +01:00
Falk David
2822777f13 Nodes: support boolean inputs as toggles in panel headers
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
2025-02-28 19:07:02 +01:00
Bastien Montagne
f6ad99c648 Merge branch 'blender-v4.4-release' 2025-02-28 15:48:13 +01:00
Damien Picard
1fc5f9d408 I18n: Disambiguate "Home"
"Home" in the context of the navigation key, as opposed to the home
directory in the file browser.

Reported by Satoshi Yamasaki.
2025-02-28 15:46:33 +01:00
Julian Eisel
80d6ad3e9d Fix: UI: Text shortening function off by one character
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
2025-02-28 11:58:52 +01:00
Jacques Lucke
b632b5c974 Nodes: UI: always draw panels as collapsible in tree view
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
2025-02-27 12:12:05 +01:00
Harley Acheson
b8a81c90d1 Merge branch 'blender-v4.4-release' 2025-02-26 20:18:18 -08:00
Harley Acheson
89e78e7065 Fix: MacOS Status Status Bar Swap Areas Spacing
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
2025-02-27 05:13:09 +01:00
John Kiril Swenson
b79344e3a0 UI: Ensure invisible scrollbar tracks are opaque and shrink scrollbars with handles
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
2025-02-26 21:57:36 +01:00
Pratik Borhade
d961f8f9ec Grease Pencil: Remove legacy object type references
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
2025-02-25 10:46:27 +01:00
Harley Acheson
67ffad53aa Merge branch 'blender-v4.4-release' 2025-02-24 18:51:52 -08:00
Harley Acheson
130c074487 Fix #131779: Display "inf" / "-inf" for Correct Range of UI Values
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
2025-02-25 03:50:23 +01:00
Hans Goudey
d0a6189b50 Refactor: DRW: Centralize and clean up packed normals conversion
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
2025-02-24 16:08:30 +01:00
Philipp Oeser
76cf859b33 Merge branch 'blender-v4.4-release' 2025-02-24 08:49:42 +01:00
Philipp Oeser
866e3d28c1 Fix #134821: "Copy To Selected" can act on non-matching nodes
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
2025-02-24 08:49:11 +01:00
Campbell Barton
85af07f438 Cleanup: spelling in comments 2025-02-23 21:02:54 +11:00