Commit Graph

120055 Commits

Author SHA1 Message Date
Clément Foucault
d5536ffd31 DRW: Do not clear 1D texture in debug mode
Clearing of 1D texture is currently unsupported.
2025-02-18 19:58:28 +01:00
Brecht Van Lommel
6458458c07 Merge branch 'blender-v4.4-release' 2025-02-18 19:46:42 +01:00
Brecht Van Lommel
c650977534 Grease Pencil: Make brush asset pinned materials local
Keeping these as linked datablocks to the brush does not match the idea
that assets should generally be appended, and leads to some confusing
situations with linked materials on objects. Now use either a local
material with matching weak library reference or make a local copy if
it does not exist yet.

This also add weak library references to the materials in the 2D Animation
template, so they will be reused.

A problem is that weak library references include a full path to assets
blend files, including the Blender version for the essentials assets files.
This means weak library references do not work across platforms and
Blender versions.

Another known limitation is that if the (linked) Brush Asset material is
edited, and there is already a local copy of it, this local copy will
remain unchanged and will be used by future strokes as well.

Ref #131186

Pull Request: https://projects.blender.org/blender/blender/pulls/134226
2025-02-18 19:46:07 +01:00
Brecht Van Lommel
1602658461 Refactor: Simplify grease pencil brush material API surface
To make changes in the following commit more clear.

Pull Request: https://projects.blender.org/blender/blender/pulls/134226
2025-02-18 19:46:07 +01:00
Brecht Van Lommel
3e03bc2278 Brush Assets: Add Material to linked editable assets
These are used to define grease pencil brushes. Not having these editable
but the brush and images being editable leads to confusing UI.

Fix #131186
Fix #134268

Pull Request: https://projects.blender.org/blender/blender/pulls/134226
2025-02-18 19:46:07 +01:00
Brecht Van Lommel
3af82d2ea0 Fix: Preserving linked editable asset datablock fails with embedded ID
This is needed to make materials work with this system.

Pull Request: https://projects.blender.org/blender/blender/pulls/134226
2025-02-18 19:46:07 +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
Harley Acheson
e2c1922c60 Merge branch 'blender-v4.4-release' 2025-02-18 10:06:39 -08:00
Harley Acheson
35d14d578c Fix #133413: Don't Use Fallback for Sequencer Text Using Custom Fonts
If a sequencer text strip is using a custom font (not the default one)
then don't use the fallback font. This adds a new font flag to disable
the use of fallback.

Pull Request: https://projects.blender.org/blender/blender/pulls/133510
2025-02-18 19:05:34 +01:00
Clément Foucault
6ae36ea114 Refactor: DRW: Move all volume and pointcloud related data into modules
Rel #134690

Pull Request: https://projects.blender.org/blender/blender/pulls/134754
2025-02-18 18:49:07 +01:00
Clément Foucault
1268774fba Refactor: DRW: Move GlobalsUboStorage handling to Overlay::Instance class
Rel #134690
2025-02-18 18:46:08 +01:00
Richard Antalik
4c2f079cca Merge branch 'blender-v4.4-release' 2025-02-18 18:33:37 +01:00
Richard Antalik
71e2e509ec Fix #134708: Audio render does not change file extension
Caused by case sensitive string comparison between RNA enum
name and pre-defined array with extensions.

The array with extensions was also missing ".aac" string.

Pull Request: https://projects.blender.org/blender/blender/pulls/134761
2025-02-18 18:31:51 +01:00
Clément Foucault
500ebdfc2f Refactor: DRW: Move color ramp texture creation to Overlay::Instance class
Rel #134690
2025-02-18 17:52:03 +01:00
Clément Foucault
cd1c1b1e95 Cleanup: Armature: Use overlay data instead of global G_draw for colors
Rel #134690
2025-02-18 17:52:03 +01:00
Hans Goudey
b520302420 Merge branch 'blender-v4.4-release' 2025-02-18 11:32:47 -05:00
Hans Goudey
4b6a212986 Cleanup: Formatting 2025-02-18 11:30:17 -05:00
Hans Goudey
2555f68267 Merge branch 'blender-v4.4-release' 2025-02-18 10:55:49 -05:00
Hans Goudey
d0a89a0950 Fix #134707: Dynamic paint brush object movement ignored
Caused by bcfe4c34da.

The code was missing a dirty tag for the positions.
2025-02-18 10:54:41 -05:00
Clément Foucault
1efd1f7ddb Refactor: DRW: Put all curves/hair related data into CurvesModule
This avoid having dangling dummy vbos as static global variables.
Also it cleansup some duplication between the hair and curves
modules.

Rel #134690

Pull Request: https://projects.blender.org/blender/blender/pulls/134751
2025-02-18 16:25:50 +01:00
Julian Eisel
73ff81db8a Merge branch 'blender-v4.4-release' 2025-02-18 16:09:55 +01:00
Sybren A. Stüvel
a228f150b3 Fix: compiler warning on Windows about an always-true check on enum value
Remove an overly-careful check on an enum value being greater than zero.
The check was added back in the day when this value was declared as
`int` and thus could easily be assigned anything.

The check for the upper limit was kept, and augmented with a
`BLI_assert()` so that failures here will actually go noticed and can
get fixed.

No actually functional changes. The data being checked is purely
runtime, and is assumed to be generated correctly already.

Pull Request: https://projects.blender.org/blender/blender/pulls/134736
2025-02-18 16:05:07 +01:00
Miguel Pozo
6b43873cf9 Cleanup: Remove unused variable 2025-02-18 16:04:27 +01:00
Sybren A. Stüvel
2393d498cb Anim: add RNA function Action.fcurve_ensure_for_datablock(...)
Expose the convenience function `blender::animrig::action_fcurve_ensure()`
to RNA as `Action.fcurve_ensure_for_datablock(...)`.

The function requires that the Action is already assigned to the
data-block. It then takes care of slot assignment / creation, as well as
the creation of a layer and a keyframe strip.

This function call:

```python
fcurve = action.fcurve_ensure_for_datablock(ob_cube, "location", index=2)
```

effectively performs this logic:

```python
# Ensure the slot exists and is assigned:
slot = ob_cube.animation_data.slot
if not slot:
    slot = find_slot_for_keying(action)
if not slot:
    slot = action.slots.new(ob_cube.name)
ob_cube.animation_data.slot = slot

# Ensure a layer exists:
if action.layers:
    layer = action.layers[0]
else:
    layer = action.layers.new("Layer")

# Ensure a keyframe strip exists:
if layer.strips:
    strip = layer.strips[0]
else:
    strip = layer.strips.new('KEYFRAME')

# Ensure the channelbag exists:
channelbag = strip.channelbag(slot, ensure=True)

# Ensure the F-Curve exists:
fcurve = channelbag.fcurves.find("location", index=1)
if not fcurve:
    fcurve = channelbag.fcurves.new("location", index=1)
```

Here `find_slot_for_keying()` represents the logic that's also used when
creating keys via the user interface or the `bpy_struct.keyframe_insert()`
function.

Pull Request: https://projects.blender.org/blender/blender/pulls/134686
2025-02-18 16:04:00 +01:00
Sybren A. Stüvel
ca388fe313 Anim: update Action RNA descriptions to clarify legacy status
Update the Action RNA descriptions, to clarify which parts of the API are
considered legacy. These will only act on the action's first slot, in an
attempt to be backward-compatible with the pre-4.4 (non-slotted) actions.

No actual functional changes, just a change in the descriptions.

Pull Request: https://projects.blender.org/blender/blender/pulls/134683
2025-02-18 16:03:29 +01:00
Julian Eisel
2e28865ece Fix (unreported): Mismatching MEM_new/MEM_freeN on button handling data
New version of b22670d927 (which was reverted with 9d33dd88d5).

I rather keep `uiHandleButtonData` private to the handling code. It
does the allocation as part of its implementation details, so it should
also handle freeing.
2025-02-18 15:57:38 +01:00
Bastien Montagne
6c1b231310 Merge branch 'blender-v4.4-release' 2025-02-18 15:47:27 +01:00
Bastien Montagne
9d33dd88d5 Revert "Fix (unreported) invalid mismatch MEM_new/MEM_freeN on but->active."
This reverts commit b22670d927.
2025-02-18 15:39:18 +01:00
Miguel Pozo
f5d56a3124 GPU: Add --profile-gpu
Add a `--profile-gpu` launch argument.

When set, it generates a profile in the Trace Event Format with CPU and
GPU metrics based on GPU debug scopes.
https://profilerpedia.markhansen.co.nz/formats/trace-event-format/

The profiles are best viewed at https://ui.perfetto.dev/

Notes:
- The profiler captures everything form app start to exit.
- Being JSON based the profiles can become relatively large, but they
  compress very well.
- Only OpenGL profiling is supported for now, but the report formatting
  code can be shared across backends.

Pull Request: https://projects.blender.org/blender/blender/pulls/133557
2025-02-18 15:36:50 +01:00
Bastien Montagne
7f43b79af0 Refactor/Fix: WM messagebus: invalid usage of calloc/free on data embedding PointerRNA.
Add a dedicated callback to duplicate the key for each type.

Keeping changes to the minimum necessary ones, the whole code and data
structure could use a serious update using C++ features, but this would
be totally out of scope of this fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/134523
2025-02-18 15:27:48 +01:00
Falk David
c47a4b1e13 Refactor: VSE: Remove scene dependency of SEQ_lookup_* functions
Instead of passing the `scene`, pass a pointer to the `Editing` struct.
This is the struct that owns the `StripLookup` in its `runtime`
so there isn't a good reason to use the `scene` pointer here
anyways.

Pull Request: https://projects.blender.org/blender/blender/pulls/134743
2025-02-18 15:16:20 +01:00
Bastien Montagne
37ecf6d03f Merge branch 'blender-v4.4-release' 2025-02-18 15:12:45 +01:00
Bastien Montagne
b22670d927 Fix (unreported) invalid mismatch MEM_new/MEM_freeN on but->active.
Found by @brecht while reviewing !134463.
2025-02-18 15:10:39 +01:00
Bastien Montagne
43c8239d2f Merge branch 'blender-v4.4-release' 2025-02-18 15:05:49 +01:00
Bastien Montagne
ba1db8392b Fix (unreported) potential memory leak in IMBuf.
Found by @brecht while reviewing !134463.
2025-02-18 14:57:01 +01:00
Bastien Montagne
24a2e0b9ec Cleanup: make format. 2025-02-18 14:47:08 +01:00
Julian Eisel
20ec789889 Merge branch 'blender-v4.4-release' 2025-02-18 14:15:28 +01:00
Julian Eisel
fa4026f2bf Revert "Fix #130372: Implements memory of the previous state of eSpace_Types."
This reverts commit afec64739a.

The commit introduces a regression where opening the Asset Browser opens
the File Browser instead, same for other editor sub-types, see
blender/blender#134630.
blender/blender!134642 proposes a different solution and reverts this,
which I prefer too. Better to the revert separately from trying a
different fix for the initial bug, makes reviewing easier too.
2025-02-18 14:09:42 +01:00
Clément Foucault
da64459aad Cleanup: DRW: Make DRW_viewport_size_get return float2
This simplify a lot of code and remove the usage of the
`DRW_viewport_invert_size_get` function.
2025-02-18 13:58:17 +01:00
Clément Foucault
3b59abbd75 Cleanup: DRW: Remove unused code 2025-02-18 13:58:17 +01:00
Clément Foucault
869ac485fb Cleanup: DRW: Remove old CPU profiling tools
This is not useful anymore. See #133557.
2025-02-18 13:58:17 +01:00
Falk David
54be463b99 Refactor: VSE: Remove scene parameter of some time functions
This removes the `scene` parameter of
`SEQ_time_get_rounded_sound_offset` and
`SEQ_time_media_playback_rate_factor_get`.
Instead, we now pass the `frames_per_second` directly.

This is an attempt at getting less of the code to be
scene dependent.

Pull Request: https://projects.blender.org/blender/blender/pulls/134741
2025-02-18 13:45:56 +01:00
Brecht Van Lommel
20138318cc Merge branch 'blender-v4.4-release' 2025-02-18 13:21:45 +01:00
Brecht Van Lommel
4e02acf2ba Fix #134607: Sequencer render animation preview not working
This main thread check was introduced in 4536a4c610. At the time OpenGL
only ever worked in the main thread, but that limitation was lifted in
Blender 2.80.

With this operator being converted to use the jobs system, it now needs
to work in non-main threads. Note that this code does not run in parallel
with main thread drawing anyway, because of WM_job_main_thread_lock_acquire
and draw manager locks. What changed is that we can now activate OpenGL
contexts on other threads.

Pull Request: https://projects.blender.org/blender/blender/pulls/134696
2025-02-18 13:21:02 +01:00
Sergey Sharybin
55e45123f5 Merge branch 'blender-v4.4-release' 2025-02-18 13:12:04 +01:00
Bastien Montagne
f8cdd3e65f Fix (unreported) Depsgraph invalid C-style allocation of non-trivial C++ data.
`DEGCustomDataMeshMasks` makes `IDInfo` struct non-trivial, so it should
not be allocated or freed with C-style allocation.

Instead of allocating this data, now use its only persistent user
(the `DepsgraphNodeBuilder::id_info_hash_` map) as owner, move the rest
of the code releasing COW IDs to a new destructor for `IDInfo`, and let
standard C++ destruction do the job.

NOTE: This change seems to give some performances improvements in
affected code (e.g. about 4% improvement in affected area of
`DepsgraphNodeBuilder::begin_build`). However, this does not affect global
performances in a measurable way.

Related to work on improving our memory allocation code in !134463.

Pull Request: https://projects.blender.org/blender/blender/pulls/134563
2025-02-18 13:02:41 +01:00
Clément Foucault
7a3ef6a8ab Cleanup: DRW: Remove draw_manager_c from DRW_gpu_wrapper.hh dependencies
This makes dependency on the draw manager clearer and improve
build time.
2025-02-18 12:50:30 +01:00
Clément Foucault
55baac215c Cleanup: DRW: Remove unused DRWTexturePool 2025-02-18 12:50:30 +01:00
Bastien Montagne
607e04c82e Core: Add warning when opening deprecated BigEndian-saved Blendfiles.
As announced in <LINK_TO_DEVTALK_POST> (*[proposed post](https://hackmd.io/@s3W_pRGTTXie8cKWRitZrA/S1SzUhqIkl)*), Big Endian support will be
fully removed from Blender 5.0.

This commit adds deprecation warning when opening such blendfiles, and a
static `#warning` when building on a Big-Endian system.

Implements 4.5-part of #125759.
2025-02-18 12:47:35 +01:00
Bastien Montagne
6b0ad2e16b Refactor: Replace RNA_POINTER_INVALIDATE RNA/BPY macro usages.
Add `PointerRNA::reset()` and `PointerRNA::invalidate()` utils functions
(both simply reset the PointerRNA data to empty state).

Replace `RNA_POINTER_INVALIDATE` macro by `PointerRNA::invalidate()`.

Follow-up to !134393 and e55d478c64.
2025-02-18 12:43:43 +01:00