Commit Graph

3094 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
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
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
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
Campbell Barton
b3dfde88f3 Cleanup: spelling in comments (check_spelling_* target)
Also uppercase acronyms: API, UTF & ASCII.
2025-05-17 10:17:37 +10: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
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
Hans Goudey
153abc372e GPU: Replace U32/I32 combination with GPU_FETCH_INT_TO_FLOAT in UI code
The conversion from int to float is not supported natively
so it ends up happening beforehand on the CPU or as a
step before the vertex buffer can be used. It's better to just
upload floats in the first place.

Related to:
- 1e1ac2bb9b
- 617858e453

Pull Request: https://projects.blender.org/blender/blender/pulls/138855
2025-05-14 15:15:21 +02: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
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
Campbell Barton
5e75a9c1e8 Cleanup: spelling in comments 2025-05-11 17:00:47 +10: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
Harley Acheson
c9e7136161 UI: Turn Off Ability to Drag Properties NavBar Away
The Properties NavBar region can be resized by dragging an edge, but
this only allows either normal width or hidden. The edge is along the
line of category tabs and it is extremely easy to hide the region
rather than select a tab. This PR remove the ability to drag the edge,
but adds a "Hide" option to the region's context menu. It also leaves
the triangular disclosure widget visible while hidden so that it can
be shown again.

Pull Request: https://projects.blender.org/blender/blender/pulls/138628
2025-05-10 02:53:56 +02:00
Harley Acheson
2d72475d62 Fix #138661: Ensure Correct SubType After Stacked Fullscreen
Going from fullscreen to temporary fullscreen (usually file browser),
and back, is AREA_FLAG_STACKED_FULLSCREEN. In this case we need to
ensure that we restore the last-used area subtype and not just the zero
base type.

Pull Request: https://projects.blender.org/blender/blender/pulls/138682
2025-05-09 20:51:38 +02:00
Harley Acheson
40b64f7cb9 UI: Adjust Hitsize for Properties NavBar Region Edge
Recent increases in region edge hit sizes, to work better with tablet
pens, made the hitspace for Properties NavBar encroach into the tab
space. This PR just narrows it and moves it away from the tabs.

Pull Request: https://projects.blender.org/blender/blender/pulls/138622
2025-05-08 21:47:02 +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
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
a37f2014fd Cleanup: sort CMake file lists 2025-05-01 12:16:00 +10:00
Guillermo Venegas
2d896877d1 Refactor: UI: Replace uiLayoutColumn with class method uiLayout::column
This converts the public `uiLayoutColumn` function to an object oriented
API (`uiLayout::column`), 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::column` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Pull Request: https://projects.blender.org/blender/blender/pulls/138034
2025-04-26 21:07:34 +02:00
Guillermo Venegas
90644b30b2 Refactor: UI: Replace uiLayoutRow with class method uiLayout::row
This converts the public `uiLayoutRow` function to an object oriented
API (`uiLayout::row`), 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::row` 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/137979
2025-04-25 19:45:25 +02:00
Aras Pranckevicius
393a1d3d88 Cleanup: DURIAN_CAMERA_SWITCH is always on
The DURIAN_CAMERA_SWITCH feature has been always on since c3401eb5cb
(2009, Blender 2.51), remove the preprocessor option to turn it off.

Pull Request: https://projects.blender.org/blender/blender/pulls/137991
2025-04-25 14:20:52 +02:00
Jonas Holzman
19fe66c940 Cleanup: Wandering semicolon in screen_ops.cc 2025-04-24 23:58:53 +02:00
Christoph Lendenfeld
9663d287fc Anim: merge keyframe jump operators
This merges the `GRAPH_OT_keyframe_jump` operator into the more generic
`SCREEN_OT_keyframe_jump` operator. (the former introduced with #108549)

The functionality of both operators is retained by running
a `switch/case` based on the editor type.
Doing so, we can filter out the Dope Sheet as well which fixes #93944
The `GRAPH_OT_keyframe_jump` is preserved, but when it is called,
it generates a warning stating it should not be used anymore.
It then calls directly into the `SCREEN_OT_keyframe_jump` to
ensure functionality doesn't drift apart.

Fixes #136176
Fixes #93944

Pull Request: https://projects.blender.org/blender/blender/pulls/137542
2025-04-24 18:01:05 +02:00
Brecht Van Lommel
fb2ba20b67 Refactor: Use more typed MEM_calloc<> and MEM_malloc<>
Pull Request: https://projects.blender.org/blender/blender/pulls/137822
2025-04-22 11:22:18 +02:00
YimingWu
dd91ba6d0e Fix (unreported): Opening N panel with mouse frees null ptr
Just guard the `nullptr`` inside `actionzone_exit` fixes the issue.
2025-04-22 13:38:37 +08:00
Brecht Van Lommel
d061b00455 Refactor: Eliminate various unsafe memcpy and memset
Some of these already have warnings with clang-tidy, others are more
safe in case these structs get (copy) constructors in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
388a21e260 Refactor: Eliminate various void pointers passed to MEM_freeN
It's safer to pass a type so that it can be checked if delete should be
used instead. Also changes a few void pointer casts to const_cast so that
if the data becomes typed it's an error.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Brecht Van Lommel
637c6497e9 Refactor: Use more typed MEM_calloc<>, avoid unnecessary size_t cast
Handle some cases that were missed in previous refactor. And eliminate
unnecessary size_t casts as these could hide issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/137404
2025-04-21 17:59:41 +02:00
Campbell Barton
3933f45f52 Cleanup: move doc-strings to declarations
Move into headers or to the top of the function body for internal
implementation details, in some cases remove duplicate doc-strings.
2025-04-18 22:58:36 +10:00
Jacques Lucke
f442c86197 Depsgraph: improve type safety when getting evaluated or original ID
The goal here is to avoid having to cast to and from `ID` when getting the
evaluated or original ID using the depsgraph API, which is often verbose and not
type safe. To solve this, there are now `DEG_get_original` and
`DEG_get_evaluated` methods which are templated on the type and use a new
`is_ID_v` static type check to make sure it's only used with valid types.

This allows removing quite some verbosity on all the call sites. I also removed
`DEG_get_original_object`, because that does not have to be a special case
anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/137629
2025-04-17 13:09:20 +02:00
Jacques Lucke
79d9e60076 Geometry Nodes: initial support for showing logged data in closures
This adds initial support for showing logged data in closures. This is more
tricky than the other zone types, because the zone content is evaluated
elsewhere. The main new thing here is a function that attempts to find where a
given closure is evaluated statically.

Finding this place statically is also important because we generally decide
which compute contexts we want to log before evaluation starts. That's because
we don't want to log everything (which is expensive), but just the places that
the user is currently looking at.

This also changed a bunch of CMakeLists.txt files so that these modules can
include NOD_* stuff, which is generally fine everywhere in editors code.

Pull Request: https://projects.blender.org/blender/blender/pulls/137403
2025-04-15 18:03:25 +02:00
Harley Acheson
2690c0266a Fix #137430: Improved Calculation of Minimum Vertical Area Heights
Since the changes that allow user select-able border widths our
calculation of minimum area heights is incorrect in that it does not
take into account border width.  This PR improves this calculation so
that as you resize windows and areas none go below header height.

Pull Request: https://projects.blender.org/blender/blender/pulls/137498
2025-04-15 01:23:41 +02:00
Campbell Barton
e1ac1a71ff RNA: use the file-path subtype & blend relative flag where supported 2025-04-11 12:22:39 +10:00
Harley Acheson
840f6f2e4c UI: FullScreen Remove Outline and Fix One Pixel Offset
When toggling area "Fullscreen" with Ctrl-Spacebar, there is a one
pixel vertical change in the top of the area. This fixes that,
removes the border and active area outline. Looks much nicer.

Pull Request: https://projects.blender.org/blender/blender/pulls/137184
2025-04-09 04:44:37 +02:00
Harley Acheson
b4194b08d4 UI: Do Not Full Hide Scroll Bars When Region Overlap
Currently scroll bars that are in regions that are set to "region
overlap" (like Tool Bar and Side Bar using a transparent background)
will fully hide when your mouse is not near them. This PR removes that
feature so that they are treated like in other areas. This way you can
always see that there are portions of the region scrolled away and what
proportion. A less jarring transition since it is only 0.4 - 1.0,
rather than 0.0 - 1.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/136571
2025-04-08 21:32:43 +02:00
Harley Acheson
b847cc0426 UI: Region Scaling Edge Highlighting
This draws a highlight line on the active edge of regions, like side
bars and toolbars, while dragging to resize them. Similar as we do for
area resizing. This has marginal utility while using a mouse, but is
much more important when using a pen. More so when the pen has a
minimum pressure for clicking. Even more so when using touch as your
finger covers the hit target.

Pull Request: https://projects.blender.org/blender/blender/pulls/136337
2025-04-08 21:12:40 +02:00
Richard Antalik
bf18e8f814 UI: Filter visible tabs in Properties Editor
This commit allows to specialize or optimize properties editor for
particular workflows by hiding individual tabs. The filtering is done on
editor level, currently in editor options popover panel.

Primary motivation was to allow strip properties to be moved to
properties editor. The filtering is beneficial, as usually it does not
make sense to show strip propeties in modelling workspace and in video
editing workspace other properties would introduce quite a bit of noise.

Ref. #115626

Pull Request: https://projects.blender.org/blender/blender/pulls/115624
2025-04-08 18:43:18 +02:00
Harley Acheson
a21481cbdd UI: Allow Changing Editor Outline Width
The gaps between editors need to be selected and manipulated in order
to resize areas. How wide these need to be depends on the accuracy and
resolution of your pointing device. And also on the fine motor control
and visual acuity of the user. If you are using a tablet pen, touch
device, or are visually or physically challenged, then you need these
gaps to be wider. This PR allows a wide latitude in this.

Pull Request: https://projects.blender.org/blender/blender/pulls/126334
2025-04-07 21:15:20 +02:00
Pratik Borhade
ed59418d2d Cleanup: Grease Pencil: Remove v3 references
Remove v3 from tooltip, code comments

Pull Request: https://projects.blender.org/blender/blender/pulls/137078
2025-04-07 11:39:16 +02:00
Campbell Barton
e7c9ea3b27 Cleanup: correct typo in variable name & comments 2025-04-05 08:49:20 +00:00
Pratik Borhade
7215da9390 Fix #136314: Outline flicker when resizing editor
When resizing area, outline flickering is caught occassionally. Border edge
is not identified sometimes which doesn't set `active_area` to null.
This eventually draws outline with `TH_EDITOR_OUTLINE_ACTIVE` color.
When moving editors, always set `active_area` ptr as null to eliminate
jumping between two theme colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/136487
2025-04-04 19:18:01 +02:00
Harley Acheson
3cb1749c31 UI: Status Bar Feedback at Corner Zone While Still
Changes only noticeable to pen users, this PR changes the status bar
information while pressing down on the corner zones but before moving
more than the threshold to start. Split-specific is not shown until
the threshold is met. Most mouse users are dead-still at this point,
but pen users have more movement which currently causes a status bar
change.

Pull Request: https://projects.blender.org/blender/blender/pulls/136900
2025-04-02 21:22:51 +02:00
Campbell Barton
bcdcc3dbde Refactor: use enum types for event modifiers & types
Use enum types for event modifier and types,
`wmEventModifierFlag` & `wmEventType` respectively.

This helps with readability and avoids unintended mixing with other
types. To quiet GCC's `-Wswitch` warnings many `default` cases needed
to be added to switch statements on event types.

Ref !136759
2025-03-31 23:48:29 +00:00
Harley Acheson
72e56ab27b Fix #136781: Ensure Area Resizing Between Scroll Bars
Neighboring areas can have right-aligned and left-aligned scroll bars
that doesn't leave room for area resizing. This PR carefully reduces
the scroll bar zone size at the area edge. To ensure that the behavior
you get matches the mouse cursor you see, this corrects an error that
we were not setting cursor when transitioning from area border to
scroll bars.

Pull Request: https://projects.blender.org/blender/blender/pulls/136794
2025-03-31 22:21:05 +02:00
Harley Acheson
cce3c27e21 UI: Use Previous Directional Cursors for Region Open Zone
Before #136334 hovering over a zone used to open closed regions, we
would show left/right or up/down directional arrow cursors. That PR
replaced those with chevron cursors that point in the specific
direction the region would open. That change has caused some confusion
so this PR restores those old cursors.

Pull Request: https://projects.blender.org/blender/blender/pulls/136583
2025-03-31 19:47:03 +02:00
Hans Goudey
ef86d9fe86 Cleanup: Remove ED_ prefix from private functions 2025-03-31 11:21:24 -04:00