Commit Graph

146695 Commits

Author SHA1 Message Date
Sybren A. Stüvel
63c3db3e96 Fix #135923: Library Overrides break action constraints
Fix an issue with library overrides that was caused by Action
assignments getting versioned too late in the versioning process. Now
the versioning of Action assignments (which assigns the
created-by-versioning action slots) happens in the 'after linking'
stage, as well as in the 'after setup' stage. The latter is still
necessary for the conversion of pre-2.5x animation data.

It is likely that the versioning code can now be simplified, as the
tagging for "this needs upgrading" may no longer be necessary. We're now
too close to the 4.4 release to comfortably make such bigger refactors,
though, so I'd rather keep the overall code structure as-is.

Pull Request: https://projects.blender.org/blender/blender/pulls/135988
2025-03-14 18:26:17 +01:00
Sybren A. Stüvel
8b6e22f36e Fix: memory leak in unit test when freeing the WM
Use a cleaner approach to the WindowManager handling in the "blendfile
loading unit test" base class, to ensure it is freed properly.

The commit following this one changes the Action versioning code, which
writes to RNA properties, which in turn sends WindowManager
notifications, which in turn have to be freed properly whenever the test
exits.

Pull Request: https://projects.blender.org/blender/blender/pulls/135988
2025-03-14 18:26:17 +01:00
Sahar A. Kashi
9ad3b74867 Fix: SSS and Motion Blur or Curves not working on HIP-RT
This change fixes the remaining failing tests with SSS when using HIP-RT.
This includes crash when SSS is used on curves, and objects with motion
blur and SSS rendering black.

The root cause for both cases was the fact that traversal was always
assuming regular BVH (built for triangles), while curves and motion
triangles are using custom primitives, which requires specialized BVH
traversal.

This change includes:

- Early output from `scene_intersect_local()` for non-triangle and
  non-motion-triangle primitives. This fixes `sss_hair.blend` test,
  and also avoids unnecessary BVH traversal when the local intersection
  is requested from curve object. The same early-output could be added
  to other BVH traversal implementation.

- Use `hiprtGeomCustomTraversalAnyHitCustomStack` for motion triangles
  primitives. This fixes motion blur on objects with SSS render black.

Fixes #135856

Co-authored-by: Sahar A. Kashi <sahar.alipourkashi@amd.com>
Co-authored-by: Sergey Sharybin <sergey@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/135943
2025-03-14 18:17:54 +01:00
Bastien Montagne
8a61555a46 Fix: IMBuf: Potential buffer overflow in JPEG metadata writer.
Looks like a logic inversion mistake.

Not clear how bad this issue is, as other code related to image metadata
seems to expect 1024 char max size too (e.g. `MAX_METADATA_STR` define
in `ed_draw.cc`. But this is potentially a very bad issue, and the fix
seems safe enough for 4.4 still.

Should also be backported to active LTSs.

Pull Request: https://projects.blender.org/blender/blender/pulls/135983
2025-03-14 18:17:21 +01:00
Philipp Oeser
6f02a485aa Fix #135927: Crash moving empty slots to new action
Check existence of layer and slot before handling Channelbags.
The existing asserts dont catch this (they are skipping the "empty
layers" case) and rightfully so, think there might be usecases for
moving **empty** slots as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135963
2025-03-14 17:19:06 +01:00
Philipp Oeser
8a0d34393d Fix #135969: Crash exporting Grease Pencil with no materials as SVG/PDF
Having no material is not uncommon, e.g. this can happen in blender when
a Curve is coverted to Grease Pencil.

If there is no material, we can still regard that stroke as visible, and use the
default Grease Pencil material in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/135975
2025-03-14 15:42:54 +01:00
Sergey Sharybin
1d4a211d6c Fix: Incorrect check of device pointers in HIP-RT code
The code was checking the same device pointer instead of
checking that both allocations are successful.

Pull Request: https://projects.blender.org/blender/blender/pulls/135977
2025-03-14 14:51:49 +01:00
Philipp Oeser
fdd402c3d8 Fix #135863: Grease Pencil Tint Modifier ignores custom curve influence
Seems this was just forgotten in baeb4d7753

To resolve, do the same as done for the "Hue/Saturation" or "Opacity"
modifiers (calculate factor along curve and evaluate curmapping).

Pull Request: https://projects.blender.org/blender/blender/pulls/135871
2025-03-14 09:18:32 +01:00
Philipp Oeser
98ab9c26c1 Fix #135857: "Affect only origins" fail for non-poly grease pencil curve
If we tag positions to be changed we get a proper update (was probably
working for poly curves because the evaluated positions just reference
the original positions array when all curves are poly curves).

Pull Request: https://projects.blender.org/blender/blender/pulls/135874
2025-03-14 09:18:01 +01:00
Sean Kim
fed2364d18 Fix #135931: Paint brush with gravity factor can crash Blender
This commit prevents the "Gravity" value from having an effect on
brushes that are based on either the Paint or Smear brush in addition to
the ones that are already filtered. Prior versions of blender don't
crash, but still deformed the mesh, which is unexpected & undesired.

Pull Request: https://projects.blender.org/blender/blender/pulls/135944
2025-03-13 20:51:24 -07:00
Miguel Pozo
08bd2d687d Fix #135848: Selection-Next: Backface culling (2)
Alternative fix for #135848.
Initially fixed by #135867, but broken again by #135917.

This performs the early return manually for the depth prepass.

Pull Request: https://projects.blender.org/blender/blender/pulls/135924
2025-03-13 19:26:15 +01:00
Miguel Pozo
ce41fbaefa Revert "Fix #135848: Selection-Next: Backface culling"
This reverts commit
44b64ca9df.
The fix is broken by
04a57dd937.
2025-03-13 16:11:33 +01:00
Clément Foucault
04a57dd937 Fix #135898: Selection: Make selection not depth aware
No depth awareness is wanted during object mode selection.
The hits are depth ordered in some selection mode but none
is supposed to reject based on depth.

Pull Request: https://projects.blender.org/blender/blender/pulls/135917
2025-03-13 15:16:05 +01:00
Miguel Pozo
44b64ca9df Fix #135848: Selection-Next: Backface culling
Allow extending the DRWState on select_bind so backface culling can be used when needed.

Note: There's still a difference in behavior with Overlay Legacy, causing backface culled flat objects to still be selectable at the edges, due to the "MeshFlat" workaround.
Pull Request: https://projects.blender.org/blender/blender/pulls/135867
2025-03-13 14:23:17 +01:00
Jesse Yurkovich
e492794e1e Fix: Resolve several int -> uint conversion shader warnings
Resolves several int -> uint conversion warnings. Warnings like the
following will be printed otherwise:

```
      |
  225 |   uint shadow_type = flags & 0xF;
      |                      ^
      | gpu_shader_text_vert.glsl:17:22: Warning: some implementations
        may not support implicit int -> uint conversions for `&'
        operators; consider casting explicitly for portability
```

Pull Request: https://projects.blender.org/blender/blender/pulls/135890
2025-03-13 14:22:21 +01:00
Sybren A. Stüvel
30ba81f805 Fix #135894: Assigned Action can mute NLA strip when reusing the same Action
Fix an issue when the NLA is used in conjunction with a directly-
assigned Action.

When the directly-assigned Action is also used in an NLA strip, that
strip would not be evaluated any more. This was even the case when
different slots were used, which entirely muted the strip when there
was no slot directly assigned. Now the "this has been handled already"
logic considers the action and the slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135911
2025-03-13 12:50:47 +01:00
Sybren A. Stüvel
1d20304442 Fix #135894: after "Merge Animation" animation does not play properly
The "Merge Animation" operator now properly tags the affected Actions
with `ID_RECALC_ANIMATION_NO_FLUSH` so that new 'evaluated copies' are
created. Because this was missing, the animation evaluation code didn't
see the moved channelbags yet, which caused animation playback to be
broken.

Pull Request: https://projects.blender.org/blender/blender/pulls/135906
2025-03-13 11:26:42 +01:00
Pratik Borhade
5a09715db9 Fix #135847: Grease Pencil: Empty material slot doesn't show icon
Move those material specific conditions below so that `icon` is always
drawn in UI even when material does not exist at specific slot.

Pull Request: https://projects.blender.org/blender/blender/pulls/135849
2025-03-13 10:17:05 +01:00
Sergey Sharybin
a3eb0faa3f Fix: Incorrect ray time used for HIP-RT local intersections
It was always hard-coded to be 0.

It does not seem to result in any extra tests passing, but they are
probably not sophisticated enough.

Noticed while looking into details for the #135856.

Pull Request: https://projects.blender.org/blender/blender/pulls/135878
2025-03-12 19:23:38 +01:00
Hans Goudey
e3df02999b Fix: Build error without FFMPEG 2025-03-12 15:32:36 +01:00
Brecht Van Lommel
a80f4ceb24 Fix #135837: Crash cancelling render with stamp burn into image
The image buffer might not exist if cancelling happens early enough.

Pull Request: https://projects.blender.org/blender/blender/pulls/135861
2025-03-12 15:31:29 +01:00
Brecht Van Lommel
92f2027f62 Fix #135806: Wrong error message on render to directory without permission
Make MOV_write_begin always report an error on failure, and remove the
generic one from the caller.

Regression from 974efe7d23.

Pull Request: https://projects.blender.org/blender/blender/pulls/135859
2025-03-12 13:39:00 +01:00
Thomas Dinges
9f66476430 Release: Blender 4.4 goes to RC 2025-03-12 12:30:03 +01:00
Thomas Dinges
9c1d1cdb9d Release: Update license doc for 4.4 2025-03-12 12:24:34 +01:00
Campbell Barton
6702645e8d AUTHORS: add 37 new authors 2025-03-12 21:52:39 +11:00
Sybren A. Stüvel
9c1845dbf2 Fix #135775: Bake to an empty Action using bake_action_objects throws error
Fix a few small mistakes in the action baking code:

- Assigning an action slot should only happen after the action itself has
  been assigned.
- `_ensure_channelbag_exists()` didn't actually ensure the channelbag
  always exists; now it also creates the layer & strip if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/135853
2025-03-12 11:46:34 +01:00
Brecht Van Lommel
73ea95a56a Fix #135644: HIP-RT crash with host memory fallback
Avoid manipulating the host pointer in device memory, this fails when host
mapped memory gets used and the pointers gets re-allocated.

Pull Request: https://projects.blender.org/blender/blender/pulls/135724
2025-03-12 11:38:07 +01:00
Brecht Van Lommel
0ff2635131 Fix #135644: Cycles HIP-RT crash when running out of memory
Tightehn up checks for failed allocations, early out on errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/135724
2025-03-12 11:37:59 +01:00
Andrej730
b2fe81a17f Fix: small typo in Alembic Mesh Sequence Cache glob check
Mistake in ea54cbe

Pull Request: https://projects.blender.org/blender/blender/pulls/135287
2025-03-12 07:28:23 +01:00
Brecht Van Lommel
1ba20699e9 Fix #135751: Small EXR files fail to load
There is a bug in OpenEXR bug where it requests at least 4096 bytes even
if the file is smaller than that. Work around it by padding with zeros.

This was fixed upstream in commit 97f857131e6b4c43ab after the 3.3.2
release, but not in any official release yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/135796
2025-03-11 19:55:28 +01:00
Thomas Dinges
8ef60f7cc8 Release: Update freedesktop file for 4.4 2025-03-11 17:10:29 +01:00
Christoph Lendenfeld
e7410abaca Fix #135666: Renaming a slot used by multiple IDs breaks animation on certain channels
The issue was that the `FCURVE_DISABLED` flag is set when an
RNA path cannot be resolved, and that skips evaluation.
However in the specific case, that is actually something expected as
the property only exists on one ID and not the other.

Pull Request: https://projects.blender.org/blender/blender/pulls/135782
2025-03-11 16:40:23 +01:00
Jonas Holzman
27117e0ffc Fix: macOS: Wrong QuickLook aspect ratio for screenshot previews of blend files
This patch fixes a visual issue where the QuickLook previews/thumbnails
of blend file (introduced in PR #107072) would have a distorted square
aspect ratio instead of their original aspect ratio. Fixed by using the
original image aspect ratio scaled to honor the QLFileThumbnailRequest's
maximumSize as per the official documentation[1].

[1]: https://developer.apple.com/documentation/quicklookthumbnailing/qlthumbnailreply/init(contextsize:currentcontextdrawing:)?language=objc

Pull Request: https://projects.blender.org/blender/blender/pulls/135691
2025-03-11 16:09:42 +01:00
Philipp Oeser
45949cffe2 Fix #127352: Image Editor mask Frame Selected wrong on non-square image
Was not taking image size/aspect into account.
Luckily, we have `BKE_mask_coord_to_image` which can do exactly that, so
use it.

NOTE: probably oversight in 96d9801423

Pull Request: https://projects.blender.org/blender/blender/pulls/135790
2025-03-11 15:23:41 +01:00
Habib Gahbiche
9fd67803dc Fix: invalid cryptomatte output image when input is not connected
**How to reproduce:**
1. Add Cryptomatte Node
2. Enable 'Object' render passes
3. Connect Cryptomatte to output (composite or viewer node)
4. Optional: set matte ID
5. (Do not connect input image)
6. Render
7. Observe invalid output image (or assert in debug build)
(see also PR for an example blend file)

Only CPU is affected. The solution follows the behavior of the GPU backend, where the input color of the single value input image is multiplied with the matte result to produce a non constant output.

Pull Request: https://projects.blender.org/blender/blender/pulls/135786
2025-03-11 14:05:04 +01:00
Julian Eisel
830342bf8e Fix #134264: Cannot undo asset catalog changes to before initial save
When saving a file, move the catalog service from the runtime asset library into the new on-disk
asset library. This makes all catalog data like the undo history and deleted catalogs be preserved.
The fact that a new asset library type gets allocated is an implementation detail that shouldn't
affect behavior.

Once the service is moved, an undo push is added (so this state can be restored to), and if the new
.blend file location can be associated with a catalog definition file, its catalogs are merged in.

Includes unit tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/135589
2025-03-11 12:49:02 +01:00
Aleš Jelovčan
dbe7078d07 Fix #135776: Grease Pencil: Average Color tool can create uninitialized values
The average color was not initialized leading to non-sensible values.
Now we initialize it to zeros.

Pull Request: https://projects.blender.org/blender/blender/pulls/135779
2025-03-11 11:49:49 +01:00
Pratik Borhade
b613be2713 Fix #135767: Grease Pencil: Separate by layer clears material user count
Material user count in duplicated ob.data is not updated. Separate layer
operation later iterates over all the material slots thenremoves unused
slots from respective objects. Since id.us=1 for individual material, if
material is used by one object but not the other, count is decremented
to zero. If we use `USER_DUP_GPENCIL` then user count is properly
handled in `grease_pencil_foreach_id/id_copy_libmanagement_cb`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135769
2025-03-11 11:33:07 +01:00
Pratik Borhade
bb36490958 Fix #135737: Grease Pencil: Cannot separate layer selected in animation editor
When a layer channel is clicked to select inside dopesheet editor, this
sets the flag `GP_LAYER_TREE_NODE_SELECT` (i.e. is_selected() to true),
It prevents separate layer operation to create a new object for this
layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/135765
2025-03-11 11:21:24 +01:00
Sybren A. Stüvel
7aeef87250 Fix: Shape Key animation not showing in Dope Sheet
Update the animation filtering code so that the shape key properties
`.eval_time` and `.interpolation` are properly shown in the Shape Key mode
of the Dope Sheet editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/135748
2025-03-11 10:38:28 +01:00
Sybren A. Stüvel
5740aded5e Fix: "Remove Empty Animation Data"
Adjust the "Remove Empty Animation Data" operator so that it properly
handles slotted Actions. It was still investigating the legacy F-Curve
list, and thus always considered Actions as "empty".

Pull Request: https://projects.blender.org/blender/blender/pulls/135740
2025-03-11 10:38:06 +01:00
Sybren A. Stüvel
064421a02d Anim: expose Action Slot users to RNA
Add a new RNA function `ActionSlot.users()` that returns the
data-blocks that are animated by this slot.

This covers direct assignment of the action & slot, but also use in
the NLA and in Action constraints.

```python
>>> D.actions['SuzanneAction'].slots['OBSuzanne'].users()
[bpy.data.objects['Suzanne']]
```

This was implemented as a function, and not a collection property,
because Blender's bookkeeping of the slot users can be marked 'dirty'.
In that case the slot user list needs to be rebuilt, which happens for
all Actions and all their slots simultaneously. This was considered
too broad a data-changing action to 'hide' inside a getter of a
property. Also it needs a `bmain` pointer, which is not available in
getters, but is available in functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/135734
2025-03-11 10:36:59 +01:00
Pratik Borhade
46086bc1c1 Fix #135436: Attribute "name collisions" show on every UIList
draw_attribute_warnings() called in every attribute panel code.
Following function iterates through entire attribute list
mesh.attributes along with vgroup list to identify the colliding name.
This results in printing collision names in irrelavant panels. Now fixed
by passing relevant attributes to compare in `draw_attribute_warnings`.
First find colliding names, add them to the list if they exists in current attribute list
passed to the function

Pull Request: https://projects.blender.org/blender/blender/pulls/135495
2025-03-11 10:28:34 +01:00
Pratik Borhade
1f3de4e0ba Cleanup: Fix comment
Enum used for separating individual layer, not just active layer

Pull Request: https://projects.blender.org/blender/blender/pulls/135771
2025-03-11 07:49:33 +01:00
Jesse Yurkovich
a5b80c06bc Fix #134764: Increase range of allowed node locations
The bug was caused because the new node's location was being clamped to
the [-100000, 100000] range. Expand this by 10x further.

Pull Request: https://projects.blender.org/blender/blender/pulls/134887
2025-03-11 06:22:34 +01:00
Campbell Barton
90e47e6bc9 Fix error saving a new imbuf from the Python API
Correct the argument for the number of planes.
2025-03-11 16:18:36 +11:00
Campbell Barton
53c8672284 Fix QuadriFlow sometimes failing when called from Python
When the QuadriFlow was called with immediate execution `G.is_break`,
if the user had pressed Escape, the value could be set to true and the
operator would immediately exit reporting the operation was canceled.
2025-03-11 13:51:49 +11:00
John Kiril Swenson
58c29625b2 Fix: UI: Action/info/console scrollbar padding/hiding state
Properly pad the action scrollbar by calling
`ED_time_scrub_clamp_scroller_mask` which was overlooked. Also hide it
when the entire view is visible. Adds versioning code to hide console
and info scrollbars as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/135142
2025-03-11 02:10:49 +01:00
John Kiril Swenson
d8f3f8cc61 Fix: UI: Improve scrollbar hotspot region
Mouse and action zone interaction for scrollbars depend on `v2d->vert`
and `v2d->hor`, which are updated through `view2d_masks`. However,
scrollbar drawing through `UI_view2d_scrollers_draw` calls
`view2d_scrollers_calc`, which pads these sizes further, meaning that
drawn scrollbars are slightly out of sync with their hotspots. This is
noticeable at track edges for shrinking scrollers or when tracks are
opaque. Fix by moving the extra (noticeable) padding code from
`view2d_scrollers_calc` to `view2d_masks`.

Pull Request: https://projects.blender.org/blender/blender/pulls/135021
2025-03-11 01:10:48 +01:00
Harley Acheson
d29f631b18 Refactor: Avoid Copying with Std::String in #135593
Commit 5ea6ffef68 used std::string in cases where StringRef or
StringRefNull could be used instead. This PR just changes those uses,
and therefore avoids some unnecessary string copying.

Pull Request: https://projects.blender.org/blender/blender/pulls/135756
2025-03-10 22:22:30 +01:00