Commit Graph

113613 Commits

Author SHA1 Message Date
Hans Goudey
8fed30aff2 Fix #134485: Missing depsgraph tag when assigning material
Caused by 81a63153d0.

Previously this was done by BKE_objects_materials_sync_length_all.
Now that function only adds a tag when it actually does something.
2025-02-13 13:16:57 -05:00
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
Brecht Van Lommel
2fb6a30b23 Refactor: Build generated DNA files as C++
Pull Request: https://projects.blender.org/blender/blender/pulls/134469
2025-02-13 18:55:37 +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
48636fcab4 Merge branch 'blender-v4.4-release' 2025-02-13 18:42:16 +01:00
Bastien Montagne
e30b78fec4 Fix (unreported) invalid usage of C-style allocation for non-trivial C++ data. 2025-02-13 18:41:41 +01:00
Jacques Lucke
1657545603 Merge branch 'blender-v4.4-release' 2025-02-13 16:48:12 +01:00
Jacques Lucke
808635e52a Fix #102598: Resample Curve node collapses curves to a single point
Collapsing curves to a single point when just resampling is unexpected. This
patch changes it so that non-zero-length curves keep at least one segment.

The fix is fairly straight forward, but a bunch of additional code is added to
support the legacy option to avoid breaking backward compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/133659
2025-02-13 16:47:10 +01:00
Jacques Lucke
39a5dc3edd Fix #134430: missing node tree update after copying data-block
There was a missing call to `BKE_main_ensure_invariants` to make sure that the
node tree is in the expected state. I'm passing the `newid` to the function so
that it can skip iterating over all of `Main` in the majority of cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/134446
2025-02-13 16:37:52 +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
8e8364f645 Merge branch 'blender-v4.4-release' 2025-02-13 20:48:23 +11:00
Campbell Barton
77eed053b2 Unbreak build WITH_PYTHON=ON & Python <= v3.12 2025-02-13 20:45:26 +11:00
Sergey Sharybin
0b369f0ff1 Fix compilation error on macOS after recent cleanup
Fixes the following error:
  error: must use 'struct' tag to refer to type 'timezone' in this scope
2025-02-13 10:28:39 +01:00
Campbell Barton
e52f85b33c Cleanup: move Python's GIL ensure/release to the function start/end
Avoid errors accessing state without the GIL (#127767) by moving
GIL ensure/release to the star/end of the function body.
2025-02-13 17:56:42 +11:00
Campbell Barton
886e40f136 Merge branch 'blender-v4.4-release' 2025-02-13 17:47:20 +11:00
Campbell Barton
39e23e29fe Cleanup: remove unnecessary call to PyGILState_Ensure
There is no need to aquire the GIL for Python methods.
2025-02-13 17:09:10 +11:00
Campbell Barton
516b39ad22 Merge branch 'blender-v4.4-release' 2025-02-13 16:57:40 +11:00
Campbell Barton
9222f157cb Fix #127767: bpy.app.handlers could run in a read-only state
Reading & restoring RNA "writable" state wasn't working reliably when
Python was called from multiple threads.

- Resolve by acquiring the GIL before calling `pyrna_write_*` functions.
- Assert `pyrna_write_*` has the GIL to prevent this happening again.
- Move duplicate checks from bpy_props.cc into utility functions.
2025-02-13 16:53:27 +11: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
Campbell Barton
e569417798 PyAPI: check registered classes don't depend on registered classes
When registering a class, warn if it's base-classes or sub-classes
are already registered as this is bad practice.

Currently the check only runs when the `--debug-python` argument is used
to avoid overhead on startup.
2025-02-13 13:04:50 +11:00
Campbell Barton
d0ac35eff4 Cleanup: add doxy-sections to bpy_rna.cc 2025-02-13 13:04:50 +11:00
Campbell Barton
c5a65ad9ed Merge branch 'blender-v4.4-release' 2025-02-13 12:01:00 +11:00
Campbell Barton
4c67c78452 PyAPI: correct unregister/register mix up in exception message
Use a shared prefix for messages to avoid copy-paste errors.

Also include class name in the exception if the class can't be
unregistered.
2025-02-13 11:59:57 +11:00
Campbell Barton
754fa4b02f Merge branch 'blender-v4.4-release' 2025-02-13 11:41:14 +11:00
Campbell Barton
09cabadcfb PyAPI: prevent built-in RNA types being unregistered
`bpy.utils.unregister_class(bpy.types.Menu)` would remove `bl_rna`
type information from the menu (also Panels & other built-int types).

Prevent unregistering built-in types since this will only cause problems.
2025-02-13 11:39:17 +11:00
Campbell Barton
61b2bf4953 Merge branch 'blender-v4.4-release' 2025-02-13 11:23:45 +11:00
Campbell Barton
e2fc2d96f8 Cleanup: wrap Python lines exceeding 120 2025-02-13 10:01:03 +11:00
Brecht Van Lommel
e2e1984e60 Refactor: Convert remainder of blenlib to C++
A few headers like BLI_math_constants.h and BLI_utildefines.h keep working
for C code, for remaining makesdna and userdef defaults code in C.

Pull Request: https://projects.blender.org/blender/blender/pulls/134406
2025-02-12 23:01:08 +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
Brecht Van Lommel
28c3476b3b Refactor: Add math.h include and DEG2RAD to BLI_math_constants
So it can be used in C code while other BLI code is converted to C++, and so
DNA headers can include it without pulling in full BLI_math_rotation.h.

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
ac764ea5a0 Merge branch 'blender-v4.4-release' 2025-02-12 12:36:23 -08: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
Pratik Borhade
0a7b765eb0 Fix #134362: Grease Pencil canvas settings don't do anything
This is due to hardcoded color and subdivision value. Also scale and
offset properties stored in overlay stuct was not considered. Now
multiply the transform matrix with `grid_mat` to make use of these
properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/134382
2025-02-12 18:51:03 +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
33db2d372f Mesh: Optimize vertex to edge attribute domain interpolation
Instead of using `DefaultMixer`, use the simpler `mix2` function.
This just decreases the overhead of computing each value.
In a simple test storing an attribute with the position of each
edge, I observed a 1.7x performance improvement: a change from
16 ms to ~9ms for an 8 million edge mesh.

Resolves #133196.
2025-02-12 11:50:14 -05:00