Commit Graph

150077 Commits

Author SHA1 Message Date
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
Brecht Van Lommel
c0f0e2ca6f Fix #129596: Cycles oneAPI crash with interactive BVH updates
There is a bug in Embree that makes BVH updates crash. Disabling multithreaded
BVH updates after the initial BVH build appears to work around it, at the cost
of some performance.

This will not affect performance of the initial BVH build, transforming objects
or editing a single mesh. It will only affect performance when multiple smaller
meshes are edited together, as those can no longer have their BVH updated in
parallel or benefit from parallellization over many primitives.

Pull Request: https://projects.blender.org/blender/blender/pulls/134747
2025-02-18 16:20:59 +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
Sergey Sharybin
0a59c7f0ea Cycles: Rudimentary utilities to plot light tree
Plotting happens from the given root node into a graphviz file.
Supports plotting from both scene level LightTreeNode and the kernel
level KernelLightTreeNode.

An external graphviz command is to be used to convert generated file
to an image.

Pull Request: https://projects.blender.org/blender/blender/pulls/134738
2025-02-18 14:29:00 +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
Sergey Sharybin
24fbd71a56 Fix #130829: Incorrect render result with light trees
The original report stumbled upon this issue with a more tricky
configuration when light linking is combined with light tress.
However, the actual contributing factor was a mesh with emission
shader which is not assigned to any triangles. This triggered a
bug in the BoundBox::transformed() which converted non-valid bounds
to bounds by performing per-corner growing.

Additionally fix incorrect handling of shared nodes which only
worked for leaf nodes. This was due to the fact how the measure
was accumulated: it is possible that add() is called with an empty
measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/134699
2025-02-18 13:11:46 +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
Pablo Delgado Krämer
94285011b0 MaterialX: Support sheen distribution input for Microfiber/Zeltner
Implement !108869 for MaterialX.

Pull Request: https://projects.blender.org/blender/blender/pulls/134126
2025-02-18 12:16:00 +01:00
Pratik Borhade
42ce049194 Fix: Grease Pencil: vgroup_select operator not working
Mistake in 8c01a59411. Jump to next drawing instead of
exiting the loop when valid group with deformverts is not found.
Found this bug during !134695

Pull Request: https://projects.blender.org/blender/blender/pulls/134734
2025-02-18 11:02:55 +01:00
Pratik Borhade
a03dd37dfe Merge branch 'blender-v4.4-release' 2025-02-18 15:18:23 +05:30
Pratik Borhade
179169d6c7 Fix #134505: Bevel redo panel closes when defining profile
Caused by 1bde901bf2
`UI_BTYPE_CURVEPROFILE` button has undo flag set. see button-layout in:
`edbm_bevel_ui() -> uiTemplateCurveProfile()`.

This  forces an undo push with the help of `ui_apply_but_undo/ui_apply_but_funcs_after`.
To handle the situation, skip undo push for buttons in hud region.

Pull Request: https://projects.blender.org/blender/blender/pulls/134552
2025-02-18 10:43:51 +01:00
Christoph Lendenfeld
996d19d4b3 Fix #129967: Annotations in the VSE not showing in Dope Sheet
The issue was that with the move to Grease Pencil v3,
annotations and normal GP use different IDs and support to show annotations
wasn't added back in.

This makes it so annotation keys are shown if "Only Show Selected" is disabled,
which works in the Dope Sheet and in the timeline.

In order to not show annotations of the scene twice, the scene-specific code is removed.
The annotations are now shown in a more generic way.

Pull Request: https://projects.blender.org/blender/blender/pulls/134565
2025-02-18 10:33:53 +01:00
Pratik Borhade
19631cae8a Fix #134428: Switching Animation Slots does not update node UI
Node region is not tagged to redraw when animation slot is changed.
`action_slot` RNA prop has `NC_ANIMATION`notifier set, use the same in
`node_region_listener` to tag region redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/134435
2025-02-18 10:33:23 +01:00
Pratik Borhade
73a9a024f9 Fix #134380: Error adding a torus after hiding a collection
This reverts 06a2617107.
Commit has introduced few errors from user perspective (#134277) and
python side (#134380). Best to revert it now then handle the bug fixes later.

The error in #134380 was due to `context.layer_collection` and
`active_layer_collection` returning excluded collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/134546
2025-02-18 10:05:59 +01:00
Harley Acheson
c3a2af00be Merge branch 'blender-v4.4-release' 2025-02-17 20:27:18 -08:00
Harley Acheson
9aeb97ccea Cleanup: Improved Comments in ui_def_but_rna__menu
Nothing but improvements to comments in this area of code to better
explain the complexity of Emum list row and column calculation. These
things change wrapping and column count to suit available space and
needs better explanation.

Pull Request: https://projects.blender.org/blender/blender/pulls/134719
2025-02-18 05:26:12 +01:00
Campbell Barton
a7924c3b65 Cleanup: quiet unused variable warning in release builds 2025-02-18 13:28:36 +11: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
Harley Acheson
f1514b45e3 Merge branch 'blender-v4.4-release' 2025-02-17 18:13:17 -08:00
Harley Acheson
b39bb42b3a Fix #134271: Reflow Non-Categorized Enum Lists Only If Necessary
For non-categorized lists, rather than always trying to find optimal
rows and columns, revert to prior behavior and only reflow if needed,
when the calculated rows are greater than maximum rows. This is less
disruptive, has less changes at small sizes where this doesn't matter.
Yet still does the job when things get too large to fit, or the list
is very long.

Pull Request: https://projects.blender.org/blender/blender/pulls/134713
2025-02-18 03:12:10 +01:00
Campbell Barton
76289d2aee Tests: commit tests/data (missing from last commit) 2025-02-18 13:09:24 +11:00