Commit Graph

5543 Commits

Author SHA1 Message Date
Philipp Oeser
e22ff684f3 Cleanup: Anim: convert cstyle-casts
Using clang-tidy "cppcoreguidelines-pro-type-cstyle-cast" to find them.

This PR touches `bf_animrig` & `bf_editor_animation` & `bf_editor_armature`

NOTE: Also some case where untouched (not straightforward) same as
expanded macros (e.g. `LISTBASE` or `GS`)
NOTE: a couple of cases of "inconsistent-declaration-parameter" as well

Pull Request: https://projects.blender.org/blender/blender/pulls/136044
2025-03-17 19:49:45 +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
Campbell Barton
ff8baa6791 Cleanup: pass BMUVOffsets by const reference 2025-03-13 17:06:32 +11:00
Julian Eisel
5ba668135a Assets: Display file name and path in asset tooltips
Part of #134755 / #134766.

Add the blend file name and directory path to the tooltip of assets in
custom asset libraries (as configured in the Preferences), for the asset
browser and asset shelf. This information is often important when
dealing with production assets. In the asset shelf it wasn't available
at all.

Based on feedback from the Blender Studio.
2025-03-11 16:21:36 +01: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
Hans Goudey
a5d1aecbc3 Merge branch 'blender-v4.4-release' 2025-03-07 12:50:29 -05:00
Campbell Barton
967fb3ae4c Fix: Grease Pencil: Crash running operators that require a 3D viewport
Correct the poll functions for reproject & texture gradient.

Pull Request: https://projects.blender.org/blender/blender/pulls/135618
2025-03-07 18:13:20 +01:00
YimingWu
ec33541b99 Fix #135611: Grease Pencil: Correct poll function for layer_group_color_tag
Operator `GREASE_PENCIL_OT_layer_group_color_tag` did not check the
existence of active layer group before executing. Now corrected with a
`poll()` callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/135612
2025-03-07 11:21:01 +01:00
Pratik Borhade
adba9bda59 Cleanup: Grease Pencil: Remove legacy undo code
Remove GP legacy undo code. Annotation doesn't require it, memfile/global
undo is used by annotation system.
Continuation of d961f8f9ec.

Pull Request: https://projects.blender.org/blender/blender/pulls/135501
2025-03-07 10:33:26 +01:00
Pratik Borhade
4e141d11c5 Cleanup: Grease Pencil: Remove legacy animation drawing code
`ANIMTYPE_GPDATABLOCK` is not used anymore animation editor for channel
drawing. `ANIMTYPE_GPLAYER` is still needed for annotation channels in
dopesheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135556
2025-03-07 10:32:33 +01:00
Philipp Oeser
be7e74972c Merge branch 'blender-v4.4-release' 2025-03-07 09:52:20 +01:00
Philipp Oeser
084cb40e98 Fix #108722 : Measures not cleared when removing annotation layer
Removing the layer would leave the ruler gizmos on screen, only way to
update was changing to another tool and back. Now remove all
corresponding gizmo ruler items found (also in different windows/scenes)
when removing the ruler annotation layer.

Also add a proper notifier that grease pencil was edited (this way we
also get immediate update when a ruler annotation layer was added --
which was also missing).

Pull Request: https://projects.blender.org/blender/blender/pulls/135571
2025-03-07 09:52:01 +01:00
Richard Antalik
68abed543b Refactor: Remove module prefix form symbols in sequnecer namespaces
Remove
SEQ_ prefix for blender::seq namespace and
ED_sequencer for blender::ed::vse namespace

Pull Request: https://projects.blender.org/blender/blender/pulls/135560
2025-03-06 13:04:39 +01:00
Richard Antalik
a08246a1a2 Refactor: Move VSE code to namespaces
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code

These names are chosen to not be in conflict with each other.
No namespace was used for RNA.

Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135500
2025-03-06 06:22:14 +01:00
Campbell Barton
f2ac9c9954 Merge branch 'blender-v4.4-release' 2025-03-06 15:54:08 +11:00
Campbell Barton
fa6975b440 Fix crash calling "Set Active Modifier" without an active object 2025-03-06 15:47:16 +11:00
Lukas Tönne
1b8185db79 Merge branch 'blender-v4.4-release' 2025-03-05 12:04:12 +01:00
Lukas Tönne
70473d7589 Fix: Grease Pencil forward declaration of RandomNumberGenerator.
This is a class, was forward-declared as struct.
2025-03-05 12:02:58 +01:00
Lukas Tönne
b66bfa345d Merge branch 'blender-v4.4-release' 2025-03-05 08:50:10 +01:00
Lukas Tönne
dc3a652d5b Fix #134606: Grease Pencil: Randomization of attributes in primitive tools
Primitive tools were not using the brush randomization options.

This moves the randomization functions into the editor utilities for Grease Pencil
and enables primitive curve generation to use them.

Pull Request: https://projects.blender.org/blender/blender/pulls/135454
2025-03-05 08:49:27 +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
Sebastian Parborg
0a9dc14c2e Merge branch 'blender-v4.4-release' 2025-03-04 13:56:10 +01:00
Nathan Vegdahl
ca980dc4f9 Fix #134746: Action Slot keyframe summary incorrect in Action Editor and Dopesheet
In the Action Editor and Dopesheet, Action/Slot summaries erroneously showed
keys that were hidden in their sub-channels.

The root cause was that the functions for building Action/Slot summary key
lists, `action_to_keylist()` and `action_slot_to_keylist()`, weren't doing
animation filtering *at all*, instead just looping over all f-curves.

This PR fixes the bug by replacing `action_slot_to_keylist()` with a new
`action_slot_summary_to_keylist()` function, which calls into the animation
filtering code to determine which f-curves to include in their key list, and
also using it in place of `action_to_keylist()` at the relevant call sites.
Additionally, properly filtering the channels for the summaries requires both a
`bAnimContext` and the ID that's being animated, so this PR threads those
through to `action_slot_summary_to_keylist()`.

Note that `action_to_keylist()` is still used in some places that actually
*want* an unfiltered list of keys. Those call sites have been left as-is, and
`action_to_keylist()` remains for that purpose.

Pull Request: https://projects.blender.org/blender/blender/pulls/134922
2025-03-04 13:52:03 +01:00
Philipp Oeser
717ddddfa1 Merge branch 'blender-v4.4-release' 2025-03-04 09:35:58 +01:00
Philipp Oeser
3589c5489a Fix: Cursor snapping does not work for Curves bezier handles
For this to work, we have to take into account handles in TransVert as
well.

Behavior is the same as in legacy curves (meaning that if the control
point itself is selected, the handles are ignores).

Part of #133448 (same thing for grease pencil, which I plan to also make
part of TransVert, but better solve for Curves first, so we can share
code here).

Pull Request: https://projects.blender.org/blender/blender/pulls/134945
2025-03-04 09:35:12 +01:00
Hans Goudey
94eff0aa06 Cleanup: Move geometry editors module function to C++ namespace 2025-03-03 22:49:55 -05:00
Hans Goudey
38c732c85f Cleanup: Deduplicate geometry attribute convert function 2025-03-03 22:48:25 -05:00
Julian Eisel
32cae542da Assets: Batch create/remove previews for all selected assets
Part of #134755 / #134766.

Previously operators to create or remove previews would only work on the
active asset/data-block. From feedback this can be quite an
inconvenience, e.g. when curating asset libraries for sharing or
production environments.

This change makes it so the following operators (all available in the
asset browser side-bar) create or remove the preview on the whole
selection:
- Generate Preview (refresh icon)
- Generate Preview from Object
- Remove Preview

Loading preview images from disk doesn't support this yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135267
2025-03-03 14:49:53 +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
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
Philipp Oeser
a8ed137e52 Merge branch 'blender-v4.4-release' 2025-02-26 15:38:50 +01:00
Philipp Oeser
bc3c6c4e7c Fix #134895: Cancelling sculpt mode elastic transforms deforms mesh
Since the transform system uses previous positions to update to
"original" positions upon cancel, the elastic transforms are not working
well with this (due to their `TransformDisplacementMode::Incremental`
nature).

To resolve, rely on restoring positions from undo (as done elsewhere in
sculpt).

Pull Request: https://projects.blender.org/blender/blender/pulls/134919
2025-02-26 15:38:29 +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
Laurynas Duburas
2c42294557 Curves: add Split operator
Adds Split operator to curves. It should have the same behavior as the
corresponding operator for legacy curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/131788
2025-02-24 11:32:59 +01:00
Bastien Montagne
8045576c60 Cleanup: Avoid some void pointer freeing for type safety
Essentially add some API to properly free non-public data, instead of directly calling `MEM_freeN` on them.

Based on @brecht code from
https://projects.blender.org/mont29/blender/compare/tmp-guardedalloc-api...brecht:free-void

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/134765
2025-02-20 11:24:34 +01:00
Sean Kim
0dd326592a Undo: Add explicit filtering for IDs and RNA structs marked as skippable
In the past, around the time that 2.80 was released, 4a08b974f4
introduced the idea of filtering out certain editor changes inside
the paint modes and edit mode (e.g. changing brush sizes in the editor).

This commit is the first in a series to attempt to refine this behavior
so that only certain editor settings are filtered out from the undo
stack.

In total, it does the following:
* Adds the Brush datablock to the list of IDs that do not have undo
  pushes.
* Adds support to filter out RNA structs that do not have the
  `STRUCT_UNDO` property applied (currently, just the 3D Cursor).

This has the following effects:
* Changing brush settings inside the Image Editor no longer causes
  undo pushes, becoming consistent with the other paint modes.
* Changing brush settings while in object mode in the outliner data
  block view no longer causes undo pushes.

Co-authored-by: Campbell Barton <campbell@blender.org>
2025-02-20 07:12:56 +01:00
Dalai Felinto
9d06f32761 Point Cloud: Select Random
Move the mask_random function to BLI_index_mask.hh, so it can be shared between curves, grease pencil and point cloud.

Copied/inspired by the curves select code.

Pull Request: https://projects.blender.org/blender/blender/pulls/134624
2025-02-19 17:23:37 +01:00
Dalai Felinto
1584cd9aa5 Cleanup: Rename point cloud to pointcloud / POINT_CLOUD to POINTCLOUD
Though "Point Cloud" written as two words is technically correct and should be used in the UI, as one word it's typically easier to write and parse when reading. We had a mix of both before this patch, so better to unify this as well.

This commit also renames the editor/intern/ files to remove pointcloud_ prefix.
point_cloud was only preserved on the user facing strings:

* is_type_point_cloud
* use_new_point_cloud_type

Pull Request: https://projects.blender.org/blender/blender/pulls/134803
2025-02-19 17:11:08 +01:00
Hans Goudey
0fd79c3613 Point Cloud: Implement join operator
Similar to !134691.

Pull Request: https://projects.blender.org/blender/blender/pulls/134702
2025-02-19 15:30:12 +01:00
Hans Goudey
5a6d2e1ce2 Curves: Implement join operator
Previously the object join operator wasn't implemented for the new
curves type. This commit implements the joining by passing the selected
curves geometry as instances to the realize instances function. That way
the complexity of the new code just relates to dealing with objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/134691
2025-02-19 15:24:29 +01:00
Harley Acheson
e850a09762 UI: Add Icons to Represent Error Conditions
This PR adds three SVG Icons. One to represent that an icon is not
found - ICON_NOT_FOUND - so represent when an out-of-range value was
used to specify an icon. The second - ICON_CHAR_NOTDEF - is to
represent that a text character is not found in the specified font or
font stack. The third - ICON_CHAR_REPLACEMENT - is to indicate the
portion of a text string that contains invalid bytes.

Pull Request: https://projects.blender.org/blender/blender/pulls/134008
2025-02-19 01:11:24 +01:00
Harley Acheson
0dce68333f UI: Vertically Aligned Grip Icon
Add a variation of the current Grip icon that is vertically-aligned.
the current ICON_GRIP works great when it has lots of horizontal space,
but ICON_GRIP_V might be needed for horizontally constrained uses.

Pull Request: https://projects.blender.org/blender/blender/pulls/134777
2025-02-19 00:19:08 +01:00
Hans Goudey
a99f9496a0 Curves: Separate to object operator
Use the existing "remove_points_and_split" utility added
for grease pencil to implement the operator for the curves
object type. The whole structure is similar to the recently
added point cloud separate operator (4cd3540579).

Pull Request: https://projects.blender.org/blender/blender/pulls/134763
2025-02-18 19:31:30 +01:00
Hans Goudey
4cd3540579 Point Cloud: Implement separate operator
Similar to existing operators, moves the selected
geometry to a new object.
2025-02-17 21:21:14 -05:00
Hans Goudey
b4c9b3e87f Cleanup: Move transform editors module to C++ namespace
Pull Request: https://projects.blender.org/blender/blender/pulls/134701
2025-02-18 01:27:04 +01:00