Commit Graph

45183 Commits

Author SHA1 Message Date
Brecht Van Lommel
4786fbe774 Refactor: Remove extern "C" from most headers
The only remaining code in source/blender that must be compiled as C
is now datatoc generated code and the DNA defaults that use designated
initializers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134469
2025-02-13 18:58:08 +01:00
Harley Acheson
83c94c6537 Merge branch 'blender-v4.4-release' 2025-02-13 09:46:08 -08:00
Fabricio Luis
afec64739a Fix #130372: Implements memory of the previous state of eSpace_Types.
This implements the memorization of the previous state of a space's
subtype for those that have multiple modes. Introduces an optional
space_subtype_prev_get callback, implemented for SPACE_ACTION,
SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE and SPACE_NODE. This means we
can always return to the previous mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/133846
2025-02-13 18:45:00 +01:00
Bastien Montagne
b6c06d13dc Merge branch 'blender-v4.4-release' 2025-02-13 13:48:51 +01:00
Bastien Montagne
343205a4da Fix (unreported) invalid mismatched usages of MEM_new/MEM_freeN. 2025-02-13 13:47:43 +01:00
Bastien Montagne
b94eefd283 Merge branch 'blender-v4.4-release' 2025-02-13 13:41:16 +01:00
Bastien Montagne
9ff4a52f8d Fix (unreported) invalid MEM_new/MEM_freeN mismatches. 2025-02-13 13:39:29 +01:00
Bastien Montagne
f3969bd1d2 Merge branch 'blender-v4.4-release' 2025-02-13 13:02:08 +01:00
Bastien Montagne
700db42976 Fix (unreported) invalid C-style allocation/freeing on non-trivial data.
`tGPsdata` embeds a `PointerRNA` member, which makes it non-trivial, and
requires it to use new/delete C++-style allocation handling.
2025-02-13 13:01:47 +01:00
YimingWu
ef844badd6 Fix #134482: Grease Pencil: Correct mask for stroke interpolation
Selection mask is included in the stroke interpolation tool in
297b97f2df, however sometimes there will
be mismatches for when start/end curve count isn't the same. This fix
ensures that the interpolation operator only works on the max amount of
curves that can fit in both start and end side of the interpolation.

Pull Request: https://projects.blender.org/blender/blender/pulls/134484
2025-02-13 12:45:53 +01:00
Julian Eisel
cc8cc48a0a Cleanup: UI: Move related tree view functions closer together
These functions are closely related, keep them together.
2025-02-13 12:11:50 +01:00
Campbell Barton
640e70b6e8 Cleanup: various non-functional changes for C++ 2025-02-13 13:33:09 +11:00
Richard Antalik
84358c5a3e Merge branch 'blender-v4.4-release' 2025-02-13 03:18:51 +01:00
Richard Antalik
789737c917 Cleanup: Refactor VSE snapping code
- Use new blender::transform namespace, to reduce verbosity
- Move snap_data allocation upstream, and use unified logic:
  No points? Free data.
- Snap points are stored in Vector instead of Array to avoid
  incrementing index.
- Point counting functions are removed. Vector size is not reserved,
  since adding 10K points takes less than 1ms (AMD 5950X)
- Functions are renamed to avoid overly long names and make them as
  distinct as possible.

New function naming scheme is:
`<what is done>_<sources/targets>_<timeline/preview>_<subcategory>`
for example `points_build_sources_timeline_retiming`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134308
2025-02-13 03:17:49 +01:00
Richard Antalik
ee9e4ead8d Fix: VSE: Retiming key translation not working correctly
Translating keys when speed transitions are present with media not
matching scene FPS causes incorrect behavior.

This was caused by multiple issues - in some places media vs scene FPS
mismatch was not accounted for and multiple instances of presision loss
due to casting float values to integer.

Pull Request: https://projects.blender.org/blender/blender/pulls/131911
2025-02-13 03:16:29 +01:00
Richard Antalik
db2108dd89 Fix #134270: Connected icon hidden when text overlays are disabled
Connected strip status is critical information, maybe more important
than strip name. Therefore it should be drawn unless all overlays are
disabled.

This commit makes the icon visible in strip "header" area even if text
overlays are disabled. Content is maximized in this case, and the icon
is drawn over the content.

![Screenshot_2025-02-12_04-50-14.png](/attachments/c2ad510b-388b-4e2f-b23c-3b494d559f38)

Pull Request: https://projects.blender.org/blender/blender/pulls/134432
2025-02-13 03:15:49 +01:00
Brecht Van Lommel
c7a33a62a2 Cleanup: Directly include DNA_userdef_types.h and BLI_listbase.h
Instead of relying on them being included indirectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +01:00
Harley Acheson
a0e492be8b Merge branch 'blender-v4.4-release' 2025-02-12 13:10:04 -08:00
Harley Acheson
bbe4bb38a0 Fix #134068: Show VSE Select Mode Variations
For many selection variations we alter the operator's displayed name to
reflect this. For example "Select (Extend)", "Select (Deselect)", and
"Select (Toggle)". This PR does similar for VSE select modes, returning
"Select (Unconnected)", "Select (Linked Time)",
"Select (Linked Handle)", and "Select (Side of Frame)". These are shown
if you press Alt or Ctrl while hovering in the VSE Editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/134195
2025-02-12 22:09:01 +01:00
Harley Acheson
16a4956ce8 UI: Status Bar During Text and Numerical Entry
While entering text into input buttons, show on Status Bar "Cancel",
"Confirm", "Select All", "Copy", "Paste". While dragging your mouse on
an a numeric input or slider show "Cancel", "Snap", "Precision".

Pull Request: https://projects.blender.org/blender/blender/pulls/133790
2025-02-12 21:33:42 +01:00
Harley Acheson
5956752eb7 UI: Themeable RedAlert, Error, Warning, Info Colors
The "Red Alert" color is currently hard-coded, which causes problems in
themes.  It also has an Enum value of 0, which precludes using this
value as "unset". We also use Error, Warning, and Info colors that are
part of the Info Editor.  This PR moves these out of the Info Editor
and into the "State" part of the theme. And then makes TH_REDALERT use
the TH_ERROR color.

Pull Request: https://projects.blender.org/blender/blender/pulls/131127
2025-02-12 20:59:47 +01:00
Harley Acheson
497f2884e8 UI: Decrease Alert Dialog Icon Size
Decrease the size of the icons shown on the large dialogs and
confirmations from 64 pixels (at 1X resolution scale) to 40.

Pull Request: https://projects.blender.org/blender/blender/pulls/134302
2025-02-12 18:30:52 +01:00
Hans Goudey
fd6df292f8 Fix #134448: Multi-object editing broken after recent fix
Caused by 638609752c.
Mistake in translation of C-style array management to Vector.
2025-02-12 11:34:36 -05:00
Hans Goudey
d41e49933b Fix: Mismatched MEM_new/MEM_freeN after recent fix
638609752c
2025-02-12 09:31:02 -05:00
Bastien Montagne
8234484904 Merge branch 'blender-v4.4-release' 2025-02-12 14:43:06 +01:00
Bastien Montagne
5a8f0bbc03 Fix (unreported) more PointerRNA-embedding structs C-styled allocated. 2025-02-12 14:40:44 +01:00
Bastien Montagne
361fc5226e Merge branch 'blender-v4.4-release' 2025-02-12 14:09:46 +01:00
Bastien Montagne
551cb3c65b Fix (unreported) invalid calloc'ed data in fmodifier_ui.
This `panel->runtime->custom_data_ptr` is `MEM_delete`'d even, so that
was plainfully wrong allocation code.

Will crash in main/4.5 due to PointerRNA now requiring proper C++
construction/destruction.
2025-02-12 14:06:55 +01:00
Harley Acheson
24fe1f2d5c UI: Disabled Message Before Python in Tooltips
As discussed in our UI Module meeting, tooltips should show disabled
message before python path. Better connects the reason to the thing
being disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/134426
2025-02-12 01:47:12 +01:00
Aaron Carlisle
fe5e712edc Merge branch 'blender-v4.4-release' 2025-02-11 18:47:28 -05:00
Aaron Carlisle
4906d8bf85 Fix: new/free mismatch
See 06be295946
2025-02-11 18:45:31 -05:00
Harley Acheson
c663b78bcb Refactor: Tooltip Calculation of Sizing and Spacing
Refactor how tooltips are sized, items placed, margins calculated, etc.
Current code has some mistakes that we use kludges to compensate for,
and it doesn't properly consider the font size in calculating margins.
The result shown to users in normal circumstances (changing resolution
scale only) with this PR applied should look identical to current.
Small changes when the text style size is changed. However, this is
mostly to allow later adjustments to padding, which currently _breaks_
when changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/134205
2025-02-12 00:09:02 +01:00
Harley Acheson
9e1d038b1e Merge branch 'blender-v4.4-release' 2025-02-11 14:32:02 -08:00
Gilberto.R
b5b786b34f Fix: UI: Close pie menu on window focus loss
Close open pie menus on window loss of focus, to prevent waiting for
the pie key release if it was released outside of focus.

Pull Request: https://projects.blender.org/blender/blender/pulls/134215
2025-02-11 23:30:31 +01:00
Brecht Van Lommel
2c34786474 Merge branch 'blender-v4.4-release' 2025-02-11 20:43:17 +01:00
Philipp Oeser
c042c67011 Fix #134395: "Intersect" selection mode not working for Grease Pencil
Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.

In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).

Pull Request: https://projects.blender.org/blender/blender/pulls/134400
2025-02-11 18:54:02 +01:00
Hans Goudey
638609752c Fix #134290: Multi-editing crash after recent refactor
Another case of C-style allocation of non-trivial objects hidden
with casting. To fix, give explicit member defaults to a few of
the UI interaction structs.
2025-02-11 12:41:18 -05:00
Jacques Lucke
374604f188 Refactor: Core: simplify accessing ListBases in Main
This replaces the `set_listbasepointers` function with `BKE_main_lists_get`
which returns an array of `ListBase *`. This simplifies the caller a bit. In
some cases, it can be simplifed further by changing the order in which we iterate
over the listbase. For historical reasons, we iterate from the back to front in
most cases but sometimes the order does not matter. I did keep the iteration order
in this patch though, to avoid regressions.

Pull Request: https://projects.blender.org/blender/blender/pulls/134242
2025-02-11 17:46:07 +01:00
Falk David
bf072eeb08 Fix: Grease Pencil: Mask icon for layer groups is not correct
This was probably caused by 3ef2ee7c53.
Now `build_layer_group_buttons` doens't need to
select a specific icon anymore. It's handled by the
RNA property.
2025-02-11 12:26:43 +01:00
Sebastian Parborg
fec27eded6 Merge branch 'blender-v4.4-release' 2025-02-11 11:40:41 +01:00
Pratik Borhade
8fc493f321 Fix #134182: Regression: Enabling Tweak disappears NLA strip
Likely caused by d94a56bdad. In `ANIMDATA_FILTER_CASES` macro,
function call to `animfilter_nla` is not made due to legacy action
condition checks. Since legacy actions are already converted to new
layered action structure in `convert_legacy_animato_actions`, it seems
safe to remove those conditions from macro.

Pull Request: https://projects.blender.org/blender/blender/pulls/134209
2025-02-11 11:35:31 +01:00
Campbell Barton
10b2ac174a Merge branch 'blender-v4.4-release' 2025-02-11 18:33:58 +11:00
Campbell Barton
29076ebd75 UI: avoid potential error accessing freed memory 2025-02-11 17:21:02 +11:00
Sean Kim
08e53db413 Merge branch 'blender-v4.4-release' 2025-02-10 09:55:13 -08:00
Nicola
92c89b504b Fix: Ignore original plane and normal when brush type is Plane
The `Plane` brush type does not use the original plane/normal
parameters. However, these parameters can be incorrectly retained when
switching type to `Plane` from another brush type where they were
enabled. This commit ensures that they are ignored for the `Plane` brush
type.

Pull Request: https://projects.blender.org/blender/blender/pulls/134255
2025-02-10 18:54:05 +01:00
Habib Gahbiche
e6260ac9f5 Fix #134107: Snapping while resizing nodes not working
The grid size varied depending on the UI scale. This caused unintended behavior with snapping while resizing nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/134123
2025-02-10 17:56:22 +01:00
Julian Eisel
ed0d01c5af UI: Remember scroll offset for tree-views
f0db870822 added support for tree-views to remember state, but only to
remember their custom height for the start. This change makes the scroll
offset be remembered too.

Not remembering the scroll offset can be very annoying in some cases,
e.g. when working with bone collections and changing the active tab in
the properties editor often. In realistic, non-trivial bone collection
set ups this can lead to a lot of repeated scrolling.

Cherry-picked for the 4.4 release since this solves a real usability
issue with trivial changes. Discussed with Thomas and others.
2025-02-10 17:43:53 +01:00
Falk David
3c075a6c56 Merge branch 'blender-v4.4-release' 2025-02-10 16:26:11 +01:00
Janne Nylander
7451a1d016 Fix unreported: Grease Pencil "Add Masking Layer" operators duplicate check always returned nullptr
Original code used the wrong type of `BLI_findstring` function, leading
to the parameters being read incorrectly and the `MaskingLayer `duplicate
check working incorrectly.

This PR changed `BLI_findstring` to `BLI_findstring_ptr`, resulting in the
`LayerMask` names being read correctly and the duplcate check working
as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/134295
2025-02-10 16:25:29 +01:00
Aras Pranckevicius
4f0fd32d6f VSE: Over Drop effect was not doing anything useful, map it to Alpha Over
Behavior of it was exactly the same as Alpha Over for the last 18 years (since
327d413eb3 in 2006 March), so just remap it to regular alpha over on file read.

Pull Request: https://projects.blender.org/blender/blender/pulls/134342
2025-02-10 16:10:01 +01:00