Commit Graph

146529 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
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
Sergey Sharybin
2050eca8bb Merge branch 'blender-v4.4-release' 2025-02-13 18:43:51 +01:00
Bastien Montagne
48636fcab4 Merge branch 'blender-v4.4-release' 2025-02-13 18:42:16 +01:00
Sergey Sharybin
ee8b9a3799 Fix: Adding new objects in HIP-RT rendered viewport errors out
The issue was caused by c0ba800f64.

Simple solution for now: check the data size and free the memory to
allow the device memory to be re-allocated. Seems the safest for the
upcoming release.

Ideally we'd need to avoid having these manual tricks with the device
memory pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/134516
2025-02-13 18:42:05 +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
Anthony Roberts
090727c039 Merge remote-tracking branch 'origin/blender-v4.4-release' 2025-02-13 16:46:34 +00:00
Anthony Roberts
ace957a124 Windows: Guard VsDevCmd env var check to ARM64 only
This is a "quick fix" guard check to unbreak things - I'll put a proper checking mechanism in later that checks if it's undefined etc

Pull Request: https://projects.blender.org/blender/blender/pulls/134512
2025-02-13 17:42:49 +01:00
Anthony Roberts
bf53ee96e5 Windows ARM64: 4.4 Library Updates
Updates the prebuilt libs to the versions used in 4.4

Also adds a check to ensure users are using at least the version of VS2022, that was used to compile the libraries

Pull Request: https://projects.blender.org/blender/blender/pulls/134405
2025-02-13 16:51:19 +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
RedMser
aa1a1d586e Fix Unreported: Use correct icons for pose markers in Action editor
The pose markers were confusing, as the selection state also changed
the shape of the icon.

`PMARKER_ACT` and `PMARKER_SEL` (resp. active and selected) now look
the same. There is no concept any more of an "active" pose marker, but
the icon is still there to avoid breaking add-ons that happen to use
it.

`PMARKER` (unselected) now uses the icon that previously was used for
`PMARKER_SEL`.

This way the pose markers are always visually different from scene
markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/132819
2025-02-13 16:23:42 +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
Janne Nylander
f702eba53f Grease Pencil: Add python operator for masking with above/below layer
Adds a new python operator to Grease Pencil for adding the layer
above or below  as a masking layers to the active layer.

Creates a new file for Grease Pencil python operators in
`scripts/startup/bl_operators/grease_pencil.py`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134401
2025-02-13 12:24:06 +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
Pratik Borhade
6d749db0c2 Fix #134468: Grease Pencil: Primtive tools considering mouse drag threshold
This is due to the click_drag event assigned for primitives. Event types
that are not "PRESS" are forwarded to drag_queue then waits until
`WM_event_drag_test_with_delta/WM_event_drag_test` is true i.e. mouse
threshold value.

Pull Request: https://projects.blender.org/blender/blender/pulls/134480
2025-02-13 11:53:03 +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
Harley Acheson
0381f18429 UI: New Presets Icons
Replacement for ICON_PRESET AND ICON_PRESET_NEW that looks like settings
on an audio mixing board.

Pull Request: https://projects.blender.org/blender/blender/pulls/134313
2025-02-13 02:44:47 +01: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
c83c62439e Cleanup: correct typo 2025-02-13 11:14:50 +11:00
Campbell Barton
d2e2cec94e Cleanup: don't sub-class other registered classes
This complicates registration logic, ideally this would raise an
exception however detecting this at run-time is quite expensive.
2025-02-13 11:11:01 +11:00
Campbell Barton
c7804568e7 Cleanup: reference imported types in class definitions 2025-02-13 10:15:19 +11:00
Campbell Barton
e2fc2d96f8 Cleanup: wrap Python lines exceeding 120 2025-02-13 10:01:03 +11:00