Commit Graph

148730 Commits

Author SHA1 Message Date
Jacques Lucke
3ae20bf166 Cleanup: remove foreach macro from .clang-format
The usage of that macro was removed in 60bec183cb,
but it was still in our .clang-format file. This lead to worse formatting when other code
used methods named `foreach`.

Pull Request: https://projects.blender.org/blender/blender/pulls/137468
2025-04-14 16:17:00 +02:00
YimingWu
47c7000392 Cleanup: Grease Pencil: Remove unused variables.
Previously the change in f5c0c81b7ee6f127f44543179f17fd475f115842 left
an unused variable and is removed by this fix.
2025-04-14 21:21:52 +08:00
Bastien Montagne
df215441eb Fix (unreported): Protect Outliner UI py code util against None context.id value.
Detected by review of !135936, the code checked for a non-empty
`context.selected_ids`, but did not propect against a potential
`None` `context.id`.
2025-04-14 14:17:42 +02:00
Jacques Lucke
e8877df863 Cleanup: simplify method name 2025-04-14 13:57:31 +02:00
Clément Foucault
3b3a5731df GPU: Shader: Change vector and matrix type to use blender convention
This unify the C++ and GLSL codebase style.

The GLSL types are still in the backend compatibility
layers to support python shaders. However, the C++
shader compilation layer doesn't have them to enforce
correct type usage.

Note that this is going to break pretty much all PRs
in flight that targets shader code.

Rel #137261

Pull Request: https://projects.blender.org/blender/blender/pulls/137369
2025-04-14 13:46:41 +02:00
Omar Emara
10af6e8ca5 Compositor: Turn Time Curve options into inputs
This patch turns the options of the Time Curve node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137465
2025-04-14 13:03:50 +02:00
Bastien Montagne
742c631d04 Fix #136432: Linked Data: Relocating libraries can assert in some cases.
As Relocate code temporarily removes some linked IDs from Main, this can
make collection hierarchy data invalid, in a way that will break
`BKE_main_collections_parent_relations_rebuild`.

For now, simply move that call outside of `BLO_library_link_end` and do
it after adding back all linked IDs to main.

Pull Request: https://projects.blender.org/blender/blender/pulls/135936
2025-04-14 12:54:50 +02:00
Bastien Montagne
3fa35aa4ee LibOverride: Improve resync when relocating linked data.
Relocation is the only case where old and new linked data may have
a different library. This makes remapping dependencies IDs for the
liboverrides that use these linked data somewhat more challenging and
complicated.

From basic tests with both simple data, and full production-level
Mikassa char, it seems to behave fairly well now.
2025-04-14 12:54:48 +02:00
Bastien Montagne
0eba8caaf9 Core: Add 'relocate' operation on individual linked ID.
So far it was only possible to relocate a whole library, now one can
also relocate a single linked ID (pulling in all of its dependencies).

This is essentially linking the new data, remapping local usages of the
old linked data to the new one, removing no more used IDs, and updating
liboverrides if needed.
2025-04-14 12:54:48 +02:00
Miguel Pozo
7f724115f7 Fix: Tests: Init thread API for GPUTests
Required by GPUSecondaryContext.
2025-04-14 12:37:49 +02:00
Bastien Montagne
22cb0b4cde I18N: Updated UI translations from git/weblate repository (834c73f29df16c). 2025-04-14 12:35:51 +02:00
Jacques Lucke
4af85f09ec Cleanup: move function docs to declaration 2025-04-14 12:35:13 +02:00
Jacques Lucke
cf5a780e7e Fix: memory leak when evaluating closure 2025-04-14 12:21:33 +02:00
Jan-Hendrik-Muller
e1163bf133 Fix Python: broken format string in API docs
This example was currently broken:
https://docs.blender.org/api/current/bpy.props.html#operator-example

Pull Request: https://projects.blender.org/blender/blender/pulls/136937
2025-04-14 11:38:43 +02:00
Brecht Van Lommel
1cb2244e90 Fix: Cycles build error when WITH_CYCLES_OSL=OFF 2025-04-14 11:35:22 +02:00
Brecht Van Lommel
72b5eff16c Fix: Remove bad ColorBand/CurveMapping/CurveProfile alloc in UI
This code should never get called, but if it did the memory would just leak
and not get stored anywhere.
2025-04-14 11:35:22 +02:00
Brecht Van Lommel
845776a665 Fix: OpenColorIO color processors pointers not deleted correctly
And change to reinterpret_cast in a few other places.
2025-04-14 11:35:22 +02:00
Omar Emara
08e73814d7 Compositor: Turn Bokeh Image options into inputs
This patch turns the options of the Bokeh Image node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/137350
2025-04-14 11:26:55 +02:00
Andrej730
035c0c8606 Fix: PyDocs: document bpy_prop_collection.values() possible None values
Document `bpy_prop_collection.values()` possibility of having
`None` values, unlike `.items()` that seems returns only bpy structs as it's values.

Example snippet with `None` values:
```python
>>> C.object.data.materials
bpy.data.meshes['Cube'].materials
>>> type(C.object.data.materials)
<class 'bpy_prop_collection'>
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.append(None)
>>> C.object.data.materials.values()
[bpy.data.materials['Material'], None, None, None]
>>> C.object.data.materials.items()
[('Material', bpy.data.materials['Material'])]
```

Pull Request: https://projects.blender.org/blender/blender/pulls/137302
2025-04-14 11:26:04 +02:00
Pratik Borhade
062c5ab225 Fix #137385: Grease Pencil: Thickness modifier doesn't work with vgroup filter
Use `get_influence_vertex_weights` for thickness modifier. This returns
array of values 0 when group is empty (see `lookup_or_default`).
Function also controls the invert state for vertex group.

Pull Request: https://projects.blender.org/blender/blender/pulls/137455
2025-04-14 10:20:49 +02:00
Jeroen Bakker
b4028ee28f Fix #137395: Vulkan: Memory reset to early
A better solution to solve the memory leak needs to be checked. Partial
revert of 3c70758f00 as it can reset GPUs
or data buffers.
2025-04-14 09:45:14 +02:00
John Kiril Swenson
5a2a6da0a2 VSE: Blade Tool Cursor
This patch adds initial cursor support for the blade tool, with bitmaps
for 16x16, 24x24, and 32x32 cursors.

Additional Changes:
- Locked strips now show a "stop" icon when hovered over.
- Previously, the frame to split was truncated when clicking in between frames.
  Now, round to the closest frame.
- Previously, the blade operator was able to select padded strip handles
  outside of strip bounds. This bug has been resolved, so that selection with
  the blade tool can only happen via box-select passthrough.

Pull Request: https://projects.blender.org/blender/blender/pulls/136749
2025-04-13 22:49:18 +02:00
Jonas Holzman
7ab0dba156 Deps: macOS arm64/x64: Add TBB CMake config files
Ref: blender/blender#137063
4.5 Library tracking issue: #136540
2025-04-13 22:41:49 +02:00
John Kiril Swenson
fe1e866fb9 VSE: Slip Operator 2.0
This patch completely reworks the slip operator from the ground up,
reorganizing code to be simpler and adding more clarifying documentation.

Major Changes:
- Add modal keymap to the operator along with an interactive status bar.
- Show offset overlays to the left and right of strips whenever slipping.
- Add option to "clamp" slipped strips.
- Rework input to be accumulative, avoiding "jumps" when transitioning in/out
  of precision mode.

Fixes:
- Properly draw header when initializing operator before any events have been
  sent, and reorganize event flow so that all events have an immediate effect.
- Properly clamp subframe slips.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/137072
2025-04-13 22:40:46 +02:00
Campbell Barton
dbf6902a19 Fix #137314: Excluded directories ignored when opening from the splash
Regression in [0] which incorrectly swapped the check for the
`use_scripts` property being set with the value it was set to.

Resolve this error as well as the "Recover Last" operator
which never worked.

[0]: 8c688a052c
2025-04-13 12:25:44 +00:00
Campbell Barton
e113c5bb91 Fix: crash drawing poly-line gesture
Regression in [0], buffer overflow reading a short array as floats.

Support short array and fix glitch where the mouse cursor wasn't
included in the poly-line.

[0]: 9d4d1aea98
2025-04-13 22:08:14 +10:00
Jacques Lucke
c11055c1cf Geometry Nodes: enable closure regression tests
Some special care had to be taken because these tests require an experimental
feature to be turned on to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/137414
2025-04-13 13:55:23 +02:00
Jacques Lucke
223412b6d5 Geometry Nodes: name based internal links in Evaluate Closure node
Previously, internal links used the same heuristics as most other nodes. However,
this is more problematic here, because I intend to use the same internal links
for the case when no closure is connected. The behavior in this case should not
change in the future if we decide to change the heuristic for internal links for
muted nodes.
2025-04-13 12:27:01 +02:00
Jacques Lucke
d9a88ce34f Fix: bad index when setting default closure outputs 2025-04-13 12:01:47 +02:00
Jacques Lucke
294a676c59 Fix: Geometry Nodes: prevent evaluating closures recursively 2025-04-13 11:01:37 +02:00
Habib Gahbiche
b3a5d03bd0 Fix: 2D gizmo in 3D shows corner and rotation handles
Corner handles are visible for light gizmo in the 3D viewport:

This was an unintentional side effect of b148593c5d

Pull Request: https://projects.blender.org/blender/blender/pulls/137356
2025-04-12 21:13:32 +02:00
Harley Acheson
d6d6a7e36f Fix #137391: Do Not Restrict Marker Operations on Region Size
Remove the checks for region size in operator_markers_region_active as
that interferes too much. The only thing really interfering with
playhead movement when the area gets too narrow is MARKER_OT_select. So
this PR adds a new poll function for that in particular. That allows a
lot of simplification.

Pull Request: https://projects.blender.org/blender/blender/pulls/137399
2025-04-12 18:18:47 +02:00
Brecht Van Lommel
6655b16207 Refactor: Hydra: Use matching texture format
Vulkan can't convert all the types, so make them match to avoid needing to
do it in the first place.

Ref #135780, #133717

Pull Request: https://projects.blender.org/blender/blender/pulls/137375
2025-04-12 14:39:51 +02:00
Campbell Barton
5affe5fc6d Cleanup: spelling in comments (make check_spelling_*) 2025-04-12 19:31:29 +10:00
Campbell Barton
10e1aaf02c PyAPI: add imbuf.load_from_buffer to support loading images from memory
Add a Python wrapper for IMB_load_image_from_memory.
2025-04-12 18:56:12 +10:00
Campbell Barton
d700bc5f54 Cleanup: remove use of unsafe string functions 2025-04-12 18:42:44 +10:00
Campbell Barton
578bf16537 Fix: integer overflow in rect buffer filling on large buffers
Other changes include:

- Replace buffer out of bounds check with an assert
  (it was only done for the byte).
- Step over pixels on each X span
  instead of calculating the offset for each pixel.
- Use const variables.
2025-04-12 05:48:04 +00:00
Campbell Barton
a30eb69a99 Fix: integer overflow for pixel lookups on large images for geonodes 2025-04-12 15:10:43 +10:00
Campbell Barton
cce9b07965 Cleanup: use shared "dummy" enum items 2025-04-12 15:06:08 +10:00
Campbell Barton
900992da5c Fix: enum values not included in Python docs for NodeTreeTypes
Partially resolves #135228.
2025-04-12 04:32:33 +00:00
Campbell Barton
ac402bf7af Tools: include STRNLEN macros in code_clean utility 2025-04-12 13:39:11 +10:00
Campbell Barton
0fb6cc72fd Cleanup: add STRNLEN macros to prevent incorrect sizeof() use
Missed in recent cleanup.
2025-04-12 13:38:22 +10:00
Campbell Barton
9d5a823246 Cleanup: replace string copy & length with STRNCPY_RLEN 2025-04-12 13:33:48 +10:00
Campbell Barton
2c8bb61187 Cleanup: add STRNLEN macros to prevent incorrect sizeof() use
This would have prevented the error fixed in
be53bab1cb.
2025-04-12 13:03:01 +10:00
Campbell Barton
be53bab1cb Fix: sequencer text insert operator clamps string length
Incorrect use of sizeof() on a pointer instead of a char[] buffer
caused the maximum string length to be clamped to the size of a pointer.
2025-04-12 12:50:31 +10:00
Campbell Barton
fbcdb748cd WM: remove arbitrary path length limit for FS_CATEGORY_OTHER
Paths were checked for being at least 3 characters in length
before being added to FS_CATEGORY_OTHER.

It looks like this was originally done to prevent the preferences
attempting to add "//" paths which is now handled by `BLI_path_is_rel`.
As it happens the old logic prior to [0] was incorrect and asserted
if textures was set to "//textures" for example.

Now only check the path isn't empty.

[0]: 968f156fae
2025-04-12 02:23:49 +00:00
Campbell Barton
272414c096 Linux: hide the "/efi" mount point in the file-browser 2025-04-12 02:09:19 +00:00
Campbell Barton
219e6aa6d6 Linux: correct mount point prefix checks
Excluding "/boot" mount point would also exclude directories
beginning with boot, without being a sub-directory.

Resolve by adding a version of STRPREFIX that delimits on null
terminator or slash.
2025-04-12 12:09:18 +10:00
Campbell Barton
3b2c0b6cd5 Fix: integer overflows calculating the number of pixels
Note that moving to the templated versions of array allocation functions
in [0] caused integer overflow regressions because multiplying by the
`sizeof(type)` caused the following values to be cast to a size_t.

[0]: e85ebb24fe
2025-04-12 01:28:30 +00:00
Campbell Barton
309bdc491b Fix: integer overflow scaling large images 2025-04-12 11:04:53 +10:00