Commit Graph

120055 Commits

Author SHA1 Message Date
Aras Pranckevicius
8e8d2e7aec Fix: Make new FBX importer support Light exposure
7e0dad0580 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
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
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
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
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 e0fc6d0c33

Pull Request: https://projects.blender.org/blender/blender/pulls/139243
2025-05-22 16:08:47 +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
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 a804320138, 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 9d86fada03 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
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
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
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
Clément Foucault
16aee8efff Fix: #138928: Metal: Custom pyGPU shader has a compilation error in 4.4
This was caused by the removal of some compatibility code
in the metal backend.

This patch reintroduce this compatibility code in a cleaner
way than before.

This should be followed up by a documentation commit that
explains what is supported and what is not.

Pull Request: https://projects.blender.org/blender/blender/pulls/139185
2025-05-22 10:36:04 +02:00
Christoph Lendenfeld
87a28fa117 Anim: Common Playhead snapping for all editors
This patch adds snapping options for the playhead to all animation editors.
The options can be modified through a new dropdown in the editor header.

All editors will show all those options, and they are shared,
so toggling the option in on editor will change it for all other editors too.
Some options are not working/relevant in some editors for example
Strips in the Dope Sheet. However for consistency the option is still shown.
This is a separate menu from the transform snapping menu because
you can toggle the snapping for transform and playhead separately.
Putting it in the existing snapping transform menu would imply that it can
be turned off with the magnet which is not the case.

Playhead snapping is explicitly disabled for the drivers editor
because there is no playhead to drag around.

Snapping to Frame/Second intervals takes the scene start as a starting point.
That means you can snap to the n-th second of the animation even though
it might not start at frame 1. The preview range is NOT taken into account
by design since the use case is working on a sub-section of the animation
in which case the snap target should not change.

Snapping is toggled by pressing CTRL as indicated by the status bar.

Snapping to Frames/Seconds is absolute, meaning no matter
how far away your cursor it will snap to the closest snap point.
All others only snap to things if they are close to the cursor in pixel values.
When mixing those two behaviors, it prefers relative snapping.
If no point is close enough to snap relative,
it will fall back to absolute snapping.

Based on the prototype #135913
Part of #135794

Pull Request: https://projects.blender.org/blender/blender/pulls/137278
2025-05-22 10:17:19 +02:00
Bastien Montagne
647927a330 Fix IDP_MergeGroup_ex not taking 'ID management' flags as parameter.
For IDProperties, this flag is mostly used only to controll whether
IDProperty code should also handle ID refcounting or not (through
`LIB_ID_CREATE_NO_USER_REFCOUNT`).

Without this fix, IDProp Group Merge could end up trying to modify ID
refcount of its data-block properties (via `IDP_FreeProperty`), which
can lead to data corruption or even crashes (e.g. when used in readfile
code, before lib-linking process).

Issue discovered while working on the system IDProperties split project
(!135807).

Pull Request: https://projects.blender.org/blender/blender/pulls/139230
2025-05-22 09:19:21 +02:00
Campbell Barton
b5d3b3c1a3 Refactor: const-correctness in BLI_array_store API 2025-05-22 17:18:39 +10:00
Clément Foucault
78170cbf90 Fix #139189: Vulkan: UV Display Issues When Selecting Specific Mesh Regions
The format was not 4 byte aligned and not compatible with the new
format enums.

Pull Request: https://projects.blender.org/blender/blender/pulls/139202
2025-05-22 09:18:08 +02:00
Jacques Lucke
74751f985d Fix #139218: implicit group inputs show input value 2025-05-22 08:36:33 +02:00
Jacques Lucke
45ee859c22 Cleanup: make format 2025-05-22 08:29:55 +02:00
Mukhesh
615eb54ef4 Fix: VSE Duplicating strips in preview operates on all strips
Deselect strips not intersecting current frame, when operator is
invoked from preview.

Pull Request: https://projects.blender.org/blender/blender/pulls/139026
2025-05-22 07:34:14 +02:00
Campbell Barton
03f292c99b Fix assert adding particle system with an active float color layer
Updating the active legacy face data layers assumed the active color
layer was a byte layer.
2025-05-22 15:03:17 +10:00
Campbell Barton
50d3516fe5 Fix #139177: Realize Instances Node results in empty curves
Regression in [0] caused by new curve data blocks being created without
"ob_type" being set.

[0]: 8fea423e00
2025-05-22 14:51:39 +10:00
Sean Kim
f5276ac09e Cleanup: Rework sculpt_undo.cc for readability
* Avoid usage of `applied` in favor of helper methods to indicate
  undo and redo requirements
* Rename `bmesh_restore_begin` and `bmesh_restore_end` to avoid
  similarity with geometry methods
* Swap `geometry_original` and `geometry_modified` to match
  expected meaning

Pull Request: https://projects.blender.org/blender/blender/pulls/139244
2025-05-22 06:39:02 +02:00
Jacques Lucke
47e84f1486 Cleanup: Nodes: remove unused method 2025-05-22 06:06:54 +02:00
Campbell Barton
e9aca43d89 Cleanup: use bool for comment variable in makesdna.cc
Also assert the value is set as expected when entering/exiting comments.
2025-05-22 13:51:29 +10:00
Campbell Barton
dbf86f291c Cleanup: prefer term "unreliable" over "flaky"
Avoid slang terms, also correct typo.
2025-05-22 13:51:29 +10:00
Campbell Barton
9c421cbef2 Fix crash in grease pencil snap without a window region
Add window region check to the poll function.
2025-05-22 03:15:13 +00:00
Campbell Barton
991d48a9ed Fix crash in vertex group lock
Resolve discrepancy in the poll/exec functions active-object check.
Also use matching object access for the enum callback.
2025-05-22 13:05:49 +10:00
Jacques Lucke
afe57f6598 Fix: unintentional fall-through in switch statement 2025-05-22 04:56:05 +02:00
Jacques Lucke
5457cca3de Nodes: auto-hide unused inputs if usage depends on menu
Previously, when a socket was detected to be unused, it was just grayed out.
This patch adds support for automatically hiding unused sockets based on this
convention: Menu inputs control visibility while other inputs only control
whether something is grayed out.

More specifically, an input is visible if any of these conditions is met:
* It affects the output currently.
* It never affects the output. In this case its usage does not depend on any
  menu input.
* It is used if all non-menu inputs are considered to be unknown.

In the future, we could support customizing which inputs are allowed to control
visibility. For now it's good to use the convention that Blender generally
follows itself.

As before, panels are grayed out if they only contain grayed out sockets and
panels are hidden when they don't contain any visible sockets.

Hiding inputs works in group nodes, the Geometry Nodes modifier and node
operators. In theory it will work for all node tree types, but since only
Geometry Nodes supports the Menu Switch node currently, this patch currently
only makes a difference there.

The implementation reuses the existing `SocketUsageInferencer` with a different
sets of inputs. So no new core-inferencing logic was needed.

Design task: #132706.

Pull Request: https://projects.blender.org/blender/blender/pulls/138186
2025-05-22 04:48:43 +02:00
Campbell Barton
10876f3f4f Fix crash in Sequencer Unmute without a valid region
Regression in [0] using the contexts "region" without a null check.

[0] 541e2b3cdd
2025-05-22 02:37:29 +00:00
Campbell Barton
937d9853a4 Fix crash in keyframe jump when called without a valid area
Regression in [0] using the contexts "area" without a null check.

[0] 9663d287fc
2025-05-22 12:22:11 +10:00
Campbell Barton
2f6b89b174 Fix crash in attribute convert/remove
Regression in [0] caused the poll function to compare the result with
nullptr instead of std::nullopt.

The operators exec function then de-referenced the the std::nullopt.

[0]: 550094b018
2025-05-22 02:18:39 +00:00
Campbell Barton
d7207a7240 Cleanup: use function style casts for generated code 2025-05-22 11:33:37 +10:00