150029 Commits

Author SHA1 Message Date
Campbell Barton
72f24fcbab Cleanup: resolve pylint warnings 2025-05-23 14:03:20 +10:00
YimingWu
845cec84bf Fix #139199: Grease Pencil: Update compositor node when pass is toggled
Compositor node sockets should be updated when toggling grease pencil
pass in the pass list. It was missing a `rna_ViewLayer_pass_update`, now
it will work as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/139215
2025-05-23 04:26:52 +02:00
Campbell Barton
98c0a6c8fe Cleanup: resolve unused variable warning in release builds 2025-05-23 09:20:11 +10:00
Guillermo Venegas
99e9b2522b Refactor: UI: Remove uiItemBooleanO API
This function has not python equivalent, using the
returned pointer to write properties seems enough,
equivalent to how it is done in Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/139295
2025-05-23 01:07:12 +02:00
Pratik Borhade
b48f3b0df4 Fix #139195: Preferences are not automatically saved after keyitem_restore
Tag preference dirty when keyitem_restore is called. When window is
closed and is_dirty=true, WM_exit_ex() will call the function to update
the prefs.

Pull Request: https://projects.blender.org/blender/blender/pulls/139254
2025-05-23 00:36:41 +02:00
Hans Goudey
cb77f6fd14 Cleanup: UI: Remove unused arguments for operator buttons 2025-05-22 16:26:46 -04:00
Sietse Brouwer
90899cf821 Python API: Let gpu_extras.presets.draw_texture_2d use TRIS instead of TRI_FAN
In the Python API, helper function `gpu_extras.presets.draw_texture_2d`
still used batch type `TRI_FAN`, which is deprecated since Blender 3.2.
In this patch the batch type is changed to `TRIS`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139300
2025-05-22 21:51:58 +02:00
Sean Kim
93f743ec46 Cleanup: Avoid passing both SculptSession and Object
Reduces the number of parameters passed in `sculpt_undo.cc`,
additionally the `const` specifier is misleading here, as the
`SculptSession` is modified via the `Object` reference.

Pull Request: https://projects.blender.org/blender/blender/pulls/139252
2025-05-22 21:10:23 +02:00
Nicola
f1ab22465f Fix: Line stroke method is drawn incorrectly
Mistake in 7d97ba4c5f20998c8d13b110fae5f384caf620dd

Pull Request: https://projects.blender.org/blender/blender/pulls/139286
2025-05-22 21:04:35 +02:00
Sean Kim
e77d82401b Fix #139223: Topology automasking crash when precomputed
The topology automask setting uses the active vertex when precomputing
the cache at the beginning of a stroke. This value can be invalid when
the brush stroke doesn't start on the mesh.

For example, this can happen with brush strokes that use a projected
instead of spherical falloff due to more BVH nodes being included in the
initial coarse check.

To fix this, simply check for the existence of the active vertex and
early exit if it is not valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/139234
2025-05-22 20:32:23 +02:00
Aras Pranckevicius
8e8d2e7aec Fix: Make new FBX importer support Light exposure
7e0dad0580124 added Light exposure import to Python FBX importer,
but not to the new C++ one

Pull Request: https://projects.blender.org/blender/blender/pulls/139292
2025-05-22 20:31:56 +02:00
Guillermo Venegas
b3eb84f624 Refactor: UI: Remove uiLayout::op id properties parameter
This was an alternative way to write properties for layout operator buttons,
for the most cases are more than enough to use the returned pointer.

There were just 2 cases where this was useful, the quick access menu
that reuses operator property values, this now overrides the id property group
data pointer generated for the operator, also for `uiItemsFullEnumO_items`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139242
2025-05-22 20:19:18 +02:00
RedMser
85dcfe70bc Fix: File Browser: Hiding dot-prefixed data-blocks
When file browsing inside a blend file's contents, allow the optional
hiding or showing of data blocks that have names that start with dot.

Pull Request: https://projects.blender.org/blender/blender/pulls/138875
2025-05-22 19:46:59 +02:00
Bastien Montagne
c31a1729bd Cleanup: Fix incorrect usages of MAX_NAME in BKE main namemap code.
This coe is about ID names, it should only rely on `MAX_ID_NAME`.
2025-05-22 17:57:23 +02:00
Miguel Pozo
e6638d6e5e Refactor: GPU: GPUMaterial & GPUPass compilation
Cleanup and simplification of GPUMaterial and GPUPass compilation.
See #133674 for details/goals.

- Remove the `draw_manage_shader` thread.
  Deferred compilation is now handled by the gpu::ShaderCompiler
  through the batch compilation API.
  Batch management is handled by the `GPUPassCache`.
- Simplify `GPUMaterial` status tracking so it just queries the
  `GPUPass` status.
- Split the `GPUPass` and the `GPUCodegen` code.
- Replaced the (broken) `GPU_material_recalc_flag_get` with the new
  `GPU_pass_compilation_timestamp`.
- Add the `GPU_pass_cache_wait_for_all` and
  `GPU_shader_batch_wait_for_all`, and remove the busy waits from
   EEVEE.
- Remove many unused functions, properties, includes...

Pull Request: https://projects.blender.org/blender/blender/pulls/135637
2025-05-22 17:53:22 +02:00
Miguel Pozo
9222daacb7 Fix: Core: bitscan_reverse_uint64 on Windows
Pull Request: https://projects.blender.org/blender/blender/pulls/139283
2025-05-22 17:30:45 +02:00
Brecht Van Lommel
7614bf9602 Docs: Fix outdated description of update in make help 2025-05-22 17:02:49 +02:00
Thomas Dinges
0379a40627 Build: Update OIIO and Manifold
* OpenImageIO to v3.0.6.1
* Manifold to v.3.1.0

Pull Request: https://projects.blender.org/blender/blender/pulls/138938
2025-05-22 16:46:12 +02:00
Campbell Barton
99a4c93081 Cleanup: inline array sizes in code-comments
Use a similar convention for struct member identifiers,
(the identifiers without surrounding spaces). This allows the values
to be scanned and validated.
2025-05-23 00:41:39 +10:00
Brecht Van Lommel
ee619713f9 Tests: Add test files for new light features
Ref #136958, #134303
2025-05-22 16:32:44 +02:00
Eqkoss / T1NT1N
bb9d5cdaad Lights: Add normalize property
When enabled, this normalize the strength by the light area, to keep
the total output the same regardless of shape or size. This is the
existing behavior.

This is supported in Cycles, EEVEE, Hydra, USD, COLLADA.

For add-ons, an API function to compute the area is added for conversion,
in case there is no native support for normalization.

area = light.area(matrix_world=ob.matrix_world)

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/136958
2025-05-22 16:32:44 +02:00
Brecht Van Lommel
a428815716 Fix: Cycles light tree poor when light normalize is off
This option was not exposed in the Blender UI, so no user visible effect.
Take into account light area when building light tree.

Ref #136958
2025-05-22 16:32:44 +02:00
Eqkoss / T1NT1N
a12bce039f Lights: Add temperature property
Similar to other renderers, this adds a temperature property to set the
light color using blackbody emission. This can be more convenient than
using nodes, and can improve interop with other software.

This is supported in Cycles, EEVEE, Hydra, USD, COLLADA and FBX.

Pull Request: https://projects.blender.org/blender/blender/pulls/134303
2025-05-22 16:32:44 +02:00
Eqkoss / T1NT1N
7e0dad0580 Lights: Add exposure property
Similar to other renderers, this adds an exposure property to multiply
the light power by 2^exposure. This can be more convenient to control
a wide range of values.

This is supported in Cycles, EEVEE, Hydra, USD, COLLADA and FBX.

Pull Request: https://projects.blender.org/blender/blender/pulls/134528
2025-05-22 16:32:44 +02:00
Brecht Van Lommel
a47954fbf2 Lights: Remove units from light power
This has been causing some confusion because it is in radiometric units
rather than photometric, which is how real world lights are typically
specified. With the addition of exposure and normalize options this
also becomes less clear.

Ref #134528
2025-05-22 16:32:44 +02:00
Brecht Van Lommel
6f45aedd85 UI: Move some advanced Cycles light settings to Settings panel
Similar to the material Settings panel. To make room for three new options
that will be added in following commits.
2025-05-22 16:32:43 +02:00
Sybren A. Stüvel
58d0b0e4b4 Py Docs: Gotcha chapter on threading
Update the Python API documentation about crashes with multi-threaded
code.

- Move the "threading gotcha" into a file of its own. That way it's
  immediately clear from looking at the Gotcha table of contents that
  threading is not supported.
- Simplify the example code, so that it doesn't access `bpy`.
  Apparently the problem is much wider than just multi-threaded access
  to `bpy`, and involves _all_ Python threads, regardless of what they
  do / access.
- Add some more explanation and move some text from the bottom to the
  top, so that the first-read part (when reading top to bottom) has
  most of the information.

Pull Request: https://projects.blender.org/blender/blender/pulls/139279
2025-05-22 16:23:23 +02:00
Hans Goudey
881199d92c Fix #139256: For each element uses incorrect default curve type
curves_new_nomain_single should only really be used for creating new
curves completely from scratch.
2025-05-22 10:18:24 -04:00
Guillermo Venegas
ae5a0d3a1b Cleanup: UI: Remove disabled RNA code
As noted in the removed comment, python has better
syntax for assigning operator properties values, as:

``` py
op = layout.operator('my_operator')
op.string_prop = "value"
```

Code has been unused since e0fc6d0c3360c1e5b61bdeefeb92cd3325780fab

Pull Request: https://projects.blender.org/blender/blender/pulls/139243
2025-05-22 16:08:47 +02:00
Michael Jones
8dd9aeb11e Cycles: Fix occasional failure in path_create_directories
This PR adds a global mutex to `path_create_directories` to fix a thread-safety issue which can occur when concurrently creating multiple subdirectories with common stems.

Pull Request: https://projects.blender.org/blender/blender/pulls/139266
2025-05-22 16:06:51 +02:00
Clément Foucault
d955ebce30 EEVEE: Default Startup Speedup
Low hanging fruit optimizations for improving default
startup time.

Went from 7.2sec to 4sec on my system.

Pull Request: https://projects.blender.org/blender/blender/pulls/139278
2025-05-22 15:57:41 +02:00
Habib Gahbiche
a4a60959b0 Refactor: Move anim data bmain ops to own file
The reason is #135223 will introduce a `#define DNA_DEPRECATED_ALLOW`
which is only relevant for the function `BKE_animdata_main_cb()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139265
2025-05-22 15:56:53 +02:00
Miguel Pozo
7654be9e88 Fix: GPU: Profiling for compilation contexts 2025-05-22 15:55:27 +02:00
Jacques Lucke
9ac3e44ce6 Spreadsheet: move context path to left side bar
Previously, we were drawing the context path in the header of the spreadsheet.
However, that had some problems:
* When using a viewer that's somewhere deep in a node group, the viewer path
  wouldn't fit.
* Standard editor menus didn't fit in. Also we wanted to add spreadsheet
  specific operators that should be in a new menu.
* Couldn't fit more useful data for the context path (like the inspection index
  for repeat zones).

This patch solves this by moving the entire context path to the left side bar.
This frees up the header for menus.

The new context panel information is added at the top of the side bar because
then there is a proper hierarchy: `Object > Evaluation State > Viewer Path
(optional) > Instance Selection > Domain Selection`

This patch also adds information about the current inspection index for for-each
and repeat zones. They are not editable yet, but that can be implemented
separately as it might require a few more changes for everything to update
correctly.

The new Viewer Path panel is only displayed when actually showing viewer data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138477
2025-05-22 15:04:41 +02:00
Bastien Montagne
4be7dad854 Cleanup: Replace incorrect MAX_ID_NAME-2 string length by MAX_NAME.
Also make use of recent 4e7b9185a4 change, and move size-hint comments
inside the brackets of the char array declaration.
2025-05-22 14:35:19 +02:00
Jeroen Bakker
de19775ab3 Fix #139141, #139169: Vulkan: Incorrect depth24s8->float conversion
The stencil value was also considered and could lead to out of range
depth values. These were ignored by operators and could lead to
printing errors, canceling operators, or inaccurate depth
selection.

This is a NVIDIA only issue as these GPU support DEPTH24S8 textures.
We should consider defaulting to DEPTH32FS8.

Pull Request: https://projects.blender.org/blender/blender/pulls/139272
2025-05-22 14:32:40 +02:00
Jeroen Bakker
b2a3caac5b Fix #138140: Vulkan: First few frames squashed on X11
Previous swapchain fixes didn't solve the issue on X11 so for X11 we still need
to disable VK_EXT_swapchain_maintenance1.

Pull Request: https://projects.blender.org/blender/blender/pulls/139270
2025-05-22 14:15:28 +02:00
Sebastian Herholz
5abf42012d Cycles: Guiding cleaning up and refactoring the guiding code
In detail:
- Direct accesses of state attributes are replaced with the INTEGRATOR_STATE and INTEGRATOR_STATE_WRITE macros.
- Unified the checks for the __PATH_GUIDING define to use #  if defined (__PATH_GUIDING__).
- Even if __PATH_GUIDING__ is defined, we now check if the feature is enabled using if ((kernel_data.kernel_features & KERNEL_FEATURE_PATH_GUIDING)) {. This is important for later GPU ports.
- The kernel usage of the guiding field, surface, and volume sampling distributions is wrapped behind macros for each specific device (atm only CPU). This will make it easier for a GPU port later.
2025-05-22 13:46:30 +02:00
Philipp Oeser
1d0c11987f Fix: Scale/Rotate proportional editing for Grease Pencil / Curves
If the `transdata_check_local_islands` check does not succeed, we end up
with `CTX_NO_PET` for scaling/rotation.

For `Grease Pencil`, this was lost in the transition from GPv2 > GPv3
(type was renamed to "legacy", then removed from
`transdata_check_local_islands` in a8043201389a, but the new type was
never added).

Curves never specified support for this, but both types are (in theory)
taking into account `V3D_AROUND_LOCAL_ORIGINS` in
`curve_populate_trans_data_structs` (logic from 9d86fada03ec might be a
bit broken for proportional editing "islands" without anything selected
as reported in #139101, but that will be corrected in another PR).

So to resolve, add `Grease Pencil` and `Curves` as supported object
types in `transdata_check_local_islands`

NOTE: `transdata_check_local_center` already has these two types as
well.

Part of #139101

Pull Request: https://projects.blender.org/blender/blender/pulls/139209
2025-05-22 13:38:22 +02:00
Clément Foucault
3d8854b021 Fix #138823: GPU: Python: Incorrect color when using widelines
Add a deprecation warning and a helper to draw with
polyline shaders.

Pull Request: https://projects.blender.org/blender/blender/pulls/139216
2025-05-22 12:42:56 +02:00
Julian Eisel
ca4b485413 Tools: Adress mypy errors in recent weekly report script additions
5a5e1b7d14 added caused some errors when running `make check_mypy`, see
https://projects.blender.org/blender/blender/pulls/138615#issuecomment-1581404.
2025-05-22 12:37:29 +02:00
Clément Foucault
57d9c2c098 GPU: Python: Temporarily add back non-4bytes aligned formats
Add back the deprecated format to avoid asserts.
GPU backends should still have the code to support them.

Also add deprecation warnings as these types will be
removed for 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/139213
2025-05-22 12:14:52 +02:00
Nikita Sirgienko
980624cc91 Build: Introduce new Device ID to OIDN 2.3.3
This ensures that OIDN 2.3.3 will support additional
Intel IP, which is important for the LTS version that
will be supported for two years into the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/139267
2025-05-22 12:04:10 +02:00
Clément Foucault
e40a9c6193 GPU: Python: Add workaround to support INT_TO_FLOAT
This promotes any INT_TO_FLOAT attribute to F32 and
to the float promotion inside python `attr_fill`.

We issue a deprecation warning when hitting this path.

Raise an error is the component type is not integer.

Pull Request: https://projects.blender.org/blender/blender/pulls/139206
2025-05-22 11:55:22 +02:00
Clément Foucault
8768e8553d Fix: GPU: Wrong colorspace on context swap
It can happen that the previous context drew with a different
colorspace. In the case where the new context is drawing with
the same shader that was previously bound (shader binding
optimization), the uniform would not be set again because the
dirty flag would not have been set (since the color space of
this new context never changed). The shader would reuse the same
colorspace as the previous context framebuffer (see #137855).

Fix #137855

Pull Request: https://projects.blender.org/blender/blender/pulls/139226
2025-05-22 11:54:29 +02:00
Clément Foucault
781b80c017 GPU: Python: Add missing diagonal constructors for square matrices
This was missing from #139185
2025-05-22 11:51:20 +02:00
Clément Foucault
f55e97a83a Documentation: Python: Add notice about MSL compatibility
See #139185
2025-05-22 11:47:06 +02:00
Habib Gahbiche
eb51e0a206 Compositor: gizmo for Split node
The gizmo is a line (implemented as a 2d cage gizmo) that can be
dragged accross the image vertically or horizontally.

Pull Request: https://projects.blender.org/blender/blender/pulls/139107
2025-05-22 11:19:09 +02:00
Campbell Barton
4e7b9185a4 makesdna: support C-style comments in array definitions
Support parsing C style comments such as:

`char filepath[/*FILE_MAX*/ 1024]`

This is done by skipping white-space inside square brackets
so the value is read as:

`char filepath[1024]`.

Ref: !139196
2025-05-22 19:08:33 +10:00
Habib Gahbiche
5e12caba08 Gizmo: Support translation without cross drawing
Add an enum entry `ED_GIZMO_CAGE_DRAW_FLAG_NOP` to be able to set enums
explicitly to draw no handles.
The current code already supports this case implicitly.

See https://projects.blender.org/blender/blender/pulls/139107 for an
example use case.

Pull Request: https://projects.blender.org/blender/blender/pulls/139210
2025-05-22 10:54:18 +02:00