Commit Graph

154049 Commits

Author SHA1 Message Date
Brecht Van Lommel
09d9239efd Fix #146619: Random Color workbench mode too saturated with ACEScg working space
Pull Request: https://projects.blender.org/blender/blender/pulls/146664
2025-09-23 18:56:31 +02:00
Dalai Felinto
e8deba14c3 Fix #145525: Scene switch should not affect viewport perspective mode
The existing behaviour traces back from pre-2.5 era. It seems like a
general sanitization technique for any operator which may change the
view transformation.

While it still makes sense to switch to PERSPECTIVE mode when actively
calling a view operator, I don't think the same should be said by simply
switching the active scene.

This PR makes it so a temporary flag is set when switching to a scene that
has no camera. This flag is kept around until we deliberately change
perspective mode. We can eventually make it so the flag is reset again in
more occasions. But the patch is good as it is.

Ref: !146364
2025-09-23 18:53:20 +02:00
Jesse Yurkovich
ec4db5825d Cleanup: Alembic: Remove deprecated scene.alembic_export API
This deprecated function looks to have been long forgotten. Both import
and export are already available as `bpy.ops.wm.alembic_import` and
`bpy.ops.wm.alembic_export`.

Pull Request: https://projects.blender.org/blender/blender/pulls/146556
2025-09-23 18:47:04 +02:00
Omar Emara
9a2c7f334b Compositor: Clarify Alpha Over input names
This patch renames the input of the Alpha Over node to use Background
and Foreground instead of just Image.

Pull Request: https://projects.blender.org/blender/blender/pulls/146352
2025-09-23 18:08:06 +02:00
Falk David
bd07749a82 Fix: VSE: Scene Sync doesn't account for scene start frame
The time synchronization function assumed that the content
of the scene strip starts at frame 0, but it should start
at the start frame of the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/146653
2025-09-23 18:02:03 +02:00
Omar Emara
7ec89d1bfb Compositor: Reorder inputs accordingly to importance
This patch reorders the inputs of some of the compositor nodes
accordingly to their importance. The importance is already quantified
internally using the domain priority of the input, so we needn't make
any subjective judgement and just order by the priority.

This breaks forward and backward compatibility if input indices were
used as opposed to input identifiers due to the different order.
Handling compatibility is not impossible, but is difficult, and it was
already ignored in many past node changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/146311
2025-09-23 17:32:07 +02:00
Julian Eisel
bafb63a654 Assets/BPY: Remove unused catalog path RNA/BPY type
This was used internally only until 2fbf206491 and was planned for
removal in 5.0, see blender/blender#122330.
2025-09-23 17:24:34 +02:00
Clément Foucault
acb2f02910 EEVEE: Reduce necessary includes
This saves a few milisecond of compile time per shader.

This removes the need for occlusion lib when not using occlusion
node.

To improve detection of uneeded includes, we add a new logging
system which output can be fed to mermaid to inspect dependencies.

The new dependencies can be inspected using `--log "gpu.shader_dependencies"`

Example pasted here:
```mermaid
flowchart LR
draw_curves_lib.glsl_7298 --> gpu_shader_math_constants_lib.glsl_600
style gpu_shader_math_constants_lib.glsl_600 fill:#0f0
gpu_shader_math_matrix_conversion_lib.glsl_1032 --> gpu_shader_math_base_lib.glsl_1406
style gpu_shader_math_base_lib.glsl_1406 fill:#1e0
gpu_shader_math_matrix_conversion_lib.glsl_1032 --> gpu_shader_math_euler_lib.glsl_461
style gpu_shader_math_euler_lib.glsl_461 fill:#0f0
gpu_shader_math_matrix_compare_lib.glsl_2964 --> gpu_shader_math_vector_compare_lib.glsl_2489
style gpu_shader_math_vector_compare_lib.glsl_2489 fill:#2d0
gpu_shader_math_matrix_conversion_lib.glsl_1032 --> gpu_shader_math_matrix_compare_lib.glsl_2964
style gpu_shader_math_matrix_compare_lib.glsl_2964 fill:#2d0
gpu_shader_math_matrix_conversion_lib.glsl_1032 --> gpu_shader_math_quaternion_lib.glsl_395
style gpu_shader_math_quaternion_lib.glsl_395 fill:#0f0
gpu_shader_math_matrix_conversion_lib.glsl_1032 --> gpu_shader_utildefines_lib.glsl_3112
style gpu_shader_utildefines_lib.glsl_3112 fill:#3c0
draw_curves_lib.glsl_7298 --> gpu_shader_math_matrix_conversion_lib.glsl_1032
style gpu_shader_math_matrix_conversion_lib.glsl_1032 fill:#1e0
draw_curves_lib.glsl_7298 --> gpu_shader_math_matrix_transform_lib.glsl_706
style gpu_shader_math_matrix_transform_lib.glsl_706 fill:#0f0
eevee_surf_deferred_frag.glsl_4531 --> draw_curves_lib.glsl_7298
style draw_curves_lib.glsl_7298 fill:#780
eevee_surf_deferred_frag.glsl_4531 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
eevee_gbuffer_lib.glsl_14598 --> gpu_shader_math_vector_reduce_lib.glsl_1383
style gpu_shader_math_vector_reduce_lib.glsl_1383 fill:#1e0
eevee_gbuffer_lib.glsl_14598 --> gpu_shader_codegen_lib.glsl_6143
style gpu_shader_codegen_lib.glsl_6143 fill:#690
eevee_gbuffer_lib.glsl_14598 --> gpu_shader_math_vector_lib.glsl_5038
style gpu_shader_math_vector_lib.glsl_5038 fill:#5a0
eevee_gbuffer_lib.glsl_14598 --> gpu_shader_utildefines_lib.glsl_3112
style gpu_shader_utildefines_lib.glsl_3112 fill:#3c0
eevee_gbuffer_write_lib.glsl_7324 --> eevee_gbuffer_lib.glsl_14598
style eevee_gbuffer_lib.glsl_14598 fill:#e10
eevee_surf_deferred_frag.glsl_4531 --> eevee_gbuffer_write_lib.glsl_7324
style eevee_gbuffer_write_lib.glsl_7324 fill:#780
eevee_ambient_occlusion_lib.glsl_10738 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
draw_math_geom_lib.glsl_5172 --> gpu_shader_math_vector_lib.glsl_5038
style gpu_shader_math_vector_lib.glsl_5038 fill:#5a0
draw_math_geom_lib.glsl_5172 --> gpu_shader_math_vector_reduce_lib.glsl_1383
style gpu_shader_math_vector_reduce_lib.glsl_1383 fill:#1e0
eevee_ray_types_lib.glsl_2390 --> draw_math_geom_lib.glsl_5172
style draw_math_geom_lib.glsl_5172 fill:#5a0
eevee_ray_types_lib.glsl_2390 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
eevee_ray_types_lib.glsl_2390 --> gpu_shader_math_matrix_transform_lib.glsl_706
style gpu_shader_math_matrix_transform_lib.glsl_706 fill:#0f0
gpu_shader_math_safe_lib.glsl_1235 --> gpu_shader_math_constants_lib.glsl_600
style gpu_shader_math_constants_lib.glsl_600 fill:#0f0
eevee_ray_types_lib.glsl_2390 --> gpu_shader_math_safe_lib.glsl_1235
style gpu_shader_math_safe_lib.glsl_1235 fill:#1e0
eevee_ray_types_lib.glsl_2390 --> gpu_shader_ray_lib.glsl_137
style gpu_shader_ray_lib.glsl_137 fill:#0f0
eevee_ambient_occlusion_lib.glsl_10738 --> eevee_ray_types_lib.glsl_2390
style eevee_ray_types_lib.glsl_2390 fill:#2d0
eevee_sampling_lib.glsl_4291 --> gpu_shader_math_base_lib.glsl_1406
style gpu_shader_math_base_lib.glsl_1406 fill:#1e0
eevee_sampling_lib.glsl_4291 --> gpu_shader_math_constants_lib.glsl_600
style gpu_shader_math_constants_lib.glsl_600 fill:#0f0
eevee_sampling_lib.glsl_4291 --> gpu_shader_math_safe_lib.glsl_1235
style gpu_shader_math_safe_lib.glsl_1235 fill:#1e0
eevee_ambient_occlusion_lib.glsl_10738 --> eevee_sampling_lib.glsl_4291
style eevee_sampling_lib.glsl_4291 fill:#4b0
eevee_ambient_occlusion_lib.glsl_10738 --> eevee_utility_tx_lib.glsl_1225
style eevee_utility_tx_lib.glsl_1225 fill:#1e0
eevee_ambient_occlusion_lib.glsl_10738 --> gpu_shader_math_base_lib.glsl_1406
style gpu_shader_math_base_lib.glsl_1406 fill:#1e0
gpu_shader_math_fast_lib.glsl_921 --> gpu_shader_math_constants_lib.glsl_600
style gpu_shader_math_constants_lib.glsl_600 fill:#0f0
eevee_ambient_occlusion_lib.glsl_10738 --> gpu_shader_math_fast_lib.glsl_921
style gpu_shader_math_fast_lib.glsl_921 fill:#0f0
gpu_shader_math_vector_safe_lib.glsl_5847 --> gpu_shader_math_safe_lib.glsl_1235
style gpu_shader_math_safe_lib.glsl_1235 fill:#1e0
eevee_ambient_occlusion_lib.glsl_10738 --> gpu_shader_math_vector_safe_lib.glsl_5847
style gpu_shader_math_vector_safe_lib.glsl_5847 fill:#5a0
eevee_ambient_occlusion_lib.glsl_10738 --> gpu_shader_utildefines_lib.glsl_3112
style gpu_shader_utildefines_lib.glsl_3112 fill:#3c0
eevee_nodetree_frag_lib.glsl_395 --> eevee_ambient_occlusion_lib.glsl_10738
style eevee_ambient_occlusion_lib.glsl_10738 fill:#a50
eevee_nodetree_frag_lib.glsl_395 --> eevee_geom_types_lib.glsl_682
style eevee_geom_types_lib.glsl_682 fill:#0f0
draw_model_lib.glsl_2563 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
eevee_nodetree_lib.glsl_16051 --> draw_model_lib.glsl_2563
style draw_model_lib.glsl_2563 fill:#2d0
draw_object_infos_lib.glsl_1114 --> draw_model_lib.glsl_2563
style draw_model_lib.glsl_2563 fill:#2d0
eevee_nodetree_lib.glsl_16051 --> draw_object_infos_lib.glsl_1114
style draw_object_infos_lib.glsl_1114 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
eevee_nodetree_lib.glsl_16051 --> eevee_renderpass_lib.glsl_1793
style eevee_renderpass_lib.glsl_1793 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> eevee_utility_tx_lib.glsl_1225
style eevee_utility_tx_lib.glsl_1225 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> gpu_shader_codegen_lib.glsl_6143
style gpu_shader_codegen_lib.glsl_6143 fill:#690
eevee_nodetree_lib.glsl_16051 --> gpu_shader_math_base_lib.glsl_1406
style gpu_shader_math_base_lib.glsl_1406 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> gpu_shader_math_safe_lib.glsl_1235
style gpu_shader_math_safe_lib.glsl_1235 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> gpu_shader_math_vector_reduce_lib.glsl_1383
style gpu_shader_math_vector_reduce_lib.glsl_1383 fill:#1e0
eevee_nodetree_lib.glsl_16051 --> gpu_shader_utildefines_lib.glsl_3112
style gpu_shader_utildefines_lib.glsl_3112 fill:#3c0
eevee_nodetree_frag_lib.glsl_395 --> eevee_nodetree_lib.glsl_16051
style eevee_nodetree_lib.glsl_16051 fill:#f00
gpu_shader_material_ambient_occlusion.glsl_558 --> gpu_shader_math_vector_safe_lib.glsl_5847
style gpu_shader_math_vector_safe_lib.glsl_5847 fill:#5a0
eevee_nodetree_frag_lib.glsl_395 --> gpu_shader_material_ambient_occlusion.glsl_558
style gpu_shader_material_ambient_occlusion.glsl_558 fill:#0f0
eevee_nodetree_frag_lib.glsl_395 --> gpu_shader_material_emission.glsl_380
style gpu_shader_material_emission.glsl_380 fill:#0f0
gpu_shader_material_output_material.glsl_850 --> gpu_shader_material_transform_utils.glsl_2136
style gpu_shader_material_transform_utils.glsl_2136 fill:#2d0
eevee_nodetree_frag_lib.glsl_395 --> gpu_shader_material_output_material.glsl_850
style gpu_shader_material_output_material.glsl_850 fill:#0f0
eevee_nodetree_frag_lib.glsl_395 --> gpu_shader_material_world_normals.glsl_128
style gpu_shader_material_world_normals.glsl_128 fill:#0f0
eevee_surf_deferred_frag.glsl_4531 --> eevee_nodetree_frag_lib.glsl_395
style eevee_nodetree_frag_lib.glsl_395 fill:#0f0
eevee_surf_deferred_frag.glsl_4531 --> eevee_sampling_lib.glsl_4291
style eevee_sampling_lib.glsl_4291 fill:#4b0
eevee_surf_lib.glsl_3650 --> draw_view_lib.glsl_3551
style draw_view_lib.glsl_3551 fill:#3c0
eevee_surf_lib.glsl_3650 --> gpu_shader_codegen_lib.glsl_6143
style gpu_shader_codegen_lib.glsl_6143 fill:#690
eevee_surf_lib.glsl_3650 --> gpu_shader_math_base_lib.glsl_1406
style gpu_shader_math_base_lib.glsl_1406 fill:#1e0
eevee_surf_lib.glsl_3650 --> gpu_shader_math_vector_safe_lib.glsl_5847
style gpu_shader_math_vector_safe_lib.glsl_5847 fill:#5a0
eevee_surf_deferred_frag.glsl_4531 --> eevee_surf_lib.glsl_3650
style eevee_surf_lib.glsl_3650 fill:#3c0
```

Pull Request: https://projects.blender.org/blender/blender/pulls/146580
2025-09-23 17:21:56 +02:00
Julian Eisel
c7b91903df BPY/UI: Rename pie menu emboss type
Renames `'RADIAL_MENU'` to `'PIE_MENU'`, to more clearly describe what
it relates to. Internally this was already done with e425faf696.

This is a 5.0 compatibility breaking change. But I couldn't find any
usages of it in bundled scripts.

Pull Request: https://projects.blender.org/blender/blender/pulls/146651
2025-09-23 16:52:46 +02:00
Guillermo Venegas
cd2cfdeab0 Allocator: Properly free polymorphic objects
Currently `MEM_delete` frees pointers expecting that they match to the
pointers allocated with `MEM_new`, otherwise it can cause undefined
behavior when freeing memory(using `--debug-memory` flag breaks in
place, if not it can corrupts other data, generating a incorrect back-traces).
However polymorphic objects lifetime can be managed by pointer of their
most derived type or by any pointer in their ancestor tree that defines
a virtual destructor, which sometimes can differ in offset when pointing to
the same object.

This changes ensures the correct pointer is being freed, by using the pointer
to the most derived type (returned by`dynamic_cast<void *>(...);`[0]).

----------

[0] = [dynamic_cast](https://en.cppreference.com/w/cpp/language/dynamic_cast.html):  `a) If expression is a pointer to (possibly cv-qualified) void, the result is a pointer to the most derived object pointed to by expression.`

-----------

As an example, given the followings structs:
```c++
struct A {
  int a;
  virtual ~A() = default;
};

struct B {
  int b;
  virtual ~B() = default;
};

struct Derived : public A , public B {
  int c;
};

std::unique_ptr<A> a_ptr = std::make_unique<Derived>();
std::unique_ptr<B> b_ptr = std::make_unique<Derived>();
```
Using std smart pointers  to manage `Derived` objects can be done with `A`
or `B` pointers.

However if a `Derived` object memory is managed with `MEM_delete`,
using a `B` pointer for freeing the memory currently may silently break Blender,
since it don't accounts for the full object memory layout, the `dynamic_cast<void *>(ptr);`
cast  gives a more safe pointer for freeing the memory.
Note that object destruction is successfully handled through the virtual destructor.

----------

This instead could be an assert to ensure polymorphic objects to be deleted
as the most derived object type.

Pull Request: https://projects.blender.org/blender/blender/pulls/146269
2025-09-23 16:50:43 +02:00
Jeroen Bakker
6872fb1aaf Vulkan: Disable Workbench image log render tests
The image log render tests uses an EXR that contains INF. Workbench
with specular enabled will mix these INFs, but there is a difference
in behavior between OpenGL and Vulkan.

In OpenGL mix(0.05, INF, 0.0) will result in INF
In Vulkan this results in NaN.

This should eventually be solved in the engine to ensure consistency.
For now we disable the render test and document the limitation.

Pull Request: https://projects.blender.org/blender/blender/pulls/146648
2025-09-23 16:45:30 +02:00
Jorn Visser
e90c08fa98 Image Paint: Support single pixel drawing
With !142495, the minimum brush radius became 0.5px, so clamp to that
instead of 1px to allow drawing single pixels. Also change how drawing
with anti-aliasing disabled works to avoid 1 pixel brush strokes not
always appearing. Now when AA is disabled, snap the cursor to either
the corners or centers of the pixels, depending on if the diameter is even
or odd, respectively.

Fixes #71403

Pull Request: https://projects.blender.org/blender/blender/pulls/146384
2025-09-23 16:06:52 +02:00
Sean Kim
289d812712 Fix #146143: MacOS UI Test failures with multiple windows
This commit bumps up the time delay while running these tests from
1/60th of a second to 1/6th of a second to ensure that the new window
is created prior to the rest of the test running while.

Pull Request: https://projects.blender.org/blender/blender/pulls/146309
2025-09-23 15:56:15 +02:00
W_Cloud
356276927f I18n: Translate menu socket tooltip, node description tooltip
Call translation function in: Menu socket tooltip and node description tooltip.
- Menu Socket Tooltip
- Node description  tooltip
- If node description is empty, not add space before idname.

Pull Request: https://projects.blender.org/blender/blender/pulls/146126
2025-09-23 15:27:14 +02:00
Philipp Oeser
af802c2eb5 Fix #146592: "Toggle Library Override Editable" acts on the wrong ID
Caused by caf11a2b9f

Above commit removed the assignment of "id" to the context (and instead
stored the "session_uid" in the button context). This is all good for
the fix it did, but... we are not getting the correct ID now in the
operator (instead, the id in context is the last item made active [by
selection] it seems).

Anyhow, to restore previous behavior, just bring back "id" to the
context (leaving the "session_uid" untouched), so we have the data to
work with in the operator.

NOTE: might be possible to retrieve the correct ID from the
"session_uid" as well -- havent looked into this much though since this
is ore tied to actual buttons it seems...

Pull Request: https://projects.blender.org/blender/blender/pulls/146599
2025-09-23 15:23:42 +02:00
Sybren A. Stüvel
e1b6cc2404 Anim: imported action slot named "Slot" when importing BVH/FBX files
Always name the imported action slot "Slot" when importing BVH and FBX
files, for ease of switching between imported Actions.

Note: this is only adjusting the old Python-based FBX importer.

Previously the slot would be named after the file itself (BVH) or had a
combination of the animated object, the animation "stack", and the
animation "layer" (FBX). This meant  that every imported animation would
get another slot name, making Action switching tedious.

Pull Request: https://projects.blender.org/blender/blender/pulls/146601
2025-09-23 15:19:55 +02:00
Pablo Vazquez
33ca6456d0 Template: Update 2D Animation template
Maintenance update to the 2D Animation template.

The following changes were made:
- Remove Timeline.
- Enable DopeSheet footer.
- Save (with compression).
- Enable "By Active Tool" in tool shelf. (suggested by the GP module)
- Remove Compositing and Rendering workspaces

All changes done in a 1920x1090 window, factory startup, without a
preferences folder.

See PR for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/146359
2025-09-23 15:04:24 +02:00
Jeroen Bakker
e0a056574d Fix: Vulkan: Volume Workbench Tests
Due to an incorrect assumption float buffers were converted to sRGB
values when uploading to an sRGBA8 texture. This is done when rendering
flames in workbench and resulted in to bright renders.

This PR removes sRGB encoding when uploading float values to sRGBA8 textures.

Fixes:
- render/openvdb/fire
- render/openvdb/principled_blackbody
- render/openvdb/smoke_fire

Pull Request: https://projects.blender.org/blender/blender/pulls/146636
2025-09-23 14:44:42 +02:00
Brecht Van Lommel
52c028e0b0 Shaders: Move repeat and closure/bundle nodes into Utilities submenu
It may be worth reconsidering how to organize these menus and add consistency
with geometry nodes. However we should at least avoid putting these as 5 new
top level entries.

Ref #141936

Pull Request: https://projects.blender.org/blender/blender/pulls/146607
2025-09-23 13:06:17 +02:00
Jeroen Bakker
ddef26505b Vulkan: Remove legacy resource tracker
Before the render graph was introduced we relied on a submission
resource tracker that allowed to resuse resources in the next frame.
With the introduction of the render graph we slowly migrated the
resource tracking to the render graph and eventually also moved the
whole discard pools to the submission runner.

There was still one part that 'used' the legacy resource tracker, but
actually didn't as it never reused resources. This PR removes the
resource tracker and migrate the push constants to use the render graph
to update a single buffer per shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/146627
2025-09-23 12:46:23 +02:00
Dalai Felinto
c8468f5cfa UI: Flip RNA icon + remove RNA_ADD
The RNA icon was rotating on the wrong direction.

Technically this is mostly a DNA helix, but even RNA can be a
double-helix sometimes. And both cases (RNA and DNA) are supposed to
have a right-hand orientation.

This PR also removes the RNA_ADD icon which is not used anywhere.

Based on suggestion by Brady Johnston.

Ref: !146600
2025-09-23 12:22:55 +02:00
Michael Jones
a14fe128fc Fix: Cycles: MetalRT motion curves setup bug
MTLAccelerationStructureMotionCurveGeometryDescriptor.controlPointCount should specify the per-step control point count. Although the previous initialisation wasn't manifesting as incorrect behaviour it was technically wrong.

Pull Request: https://projects.blender.org/blender/blender/pulls/146568
2025-09-23 12:19:44 +02:00
Bastien Montagne
f7c01e8076 Fix (unreported) Invalid clearing handling in IDP_ResizeIDPArray.
This function would only call `IDP_FreePropertyContent` on the items it
is releasing from its buffer, when reducing the length of the array.

However, it needs to call `IDP_ClearProperty` instead, otherwise some
invalid 'dirty' data is kept in the released properties, e.g. the `len`
value for groups or arrays.

Not sure how this never bit us before, but the recent asserts added by
6cb2226f13 did trigger in that case, once the code was re-using these
released IDProps.

Pull Request: https://projects.blender.org/blender/blender/pulls/146326
2025-09-23 12:10:28 +02:00
Dalai Felinto
61c8c04fac VSE: Fix Edit scene showing in the Add Scene Strip menu
Regression introduced on: 851e5b55af

Pull Request: https://projects.blender.org/blender/blender/pulls/146631
2025-09-23 12:10:15 +02:00
Hans Goudey
e1c121cd6a Fix: Crash accessing RNA UV map boolean property
Currently accessing these three separate boolean layers can
actually _create_ other attributes. Currently this can cause a
crash because it invalidates the pointers to other CustomData
layers. But it's also just logically wrong. Instead add functions
`vertex_selection_ensure()`, `edge_selection_ensure()` and
`pin_ensure()` to get the old behavior, and make the property
access just give empty collections if there is no boolean layer.

Part of #145877.

Pull Request: https://projects.blender.org/blender/blender/pulls/146611
2025-09-23 11:57:16 +02:00
Falk David
2b53ed9add Fix: VSE: Python errors when no sequencer scene is present
There were multiple places in the UI code that assumed
that the sequencer scene and tool settings exist, when
they might not.
2025-09-23 11:51:54 +02:00
Weizhen Huang
8d6b935466 Fix #144711: Cycles: rescale throughput when density is above the majorant
The one-sample Monte Carlo estimator of the radiative transfer equation
is
       <L> = T(t) / p(t) * (L_e + σ_s * L_s + σ_n * L),
Which means we can also use another p(t) than majorant * exp(-majorant * t)
for sampling the distance. Thus, we use the baked σ_max for distance
sampling, but adjust the majorant when we encounter a density that is
larger than σ_max.

Note that this is not really unbiased because such scaling is not always
applied, but seems to work well in practice when the majorant is
reasonable.

Pull Request: https://projects.blender.org/blender/blender/pulls/146589
2025-09-23 11:17:19 +02:00
Namit Bhutani
357bfc3cff Fix #146466: Sculpt undo applies evaluated positions incorrectly
Undo compression stored evaluated mesh positions instead of base mesh
positions when deform modifiers were active.
**Solution** : Modified `compress_fn` to compress `orig_position` data
when available (deform modifiers active), falling back to regular
position data otherwise.

Pull Request: https://projects.blender.org/blender/blender/pulls/146498
2025-09-23 10:55:15 +02:00
Damien Picard
f2126e211f Fix: URL prefix for experimental preferences
Recent commit 4c2ea47aec changed the URL prefix for experimental
preferences, missing a "/" and making them look like:

`https://projects.blender.orgblender/blender/issues/83811`

instead of:

`https://projects.blender.org/blender/blender/issues/83811`

Ref !145215

Pull Request: https://projects.blender.org/blender/blender/pulls/146531
2025-09-23 10:00:09 +02:00
Campbell Barton
4b82edd53c Cleanup: minor changes to the BMesh Python API
- Add typed array access functions, avoiding the need for casting.
- Share error prefix for exceptions.
- Use "num" suffix instead of "len".
2025-09-23 13:35:33 +10:00
Campbell Barton
16118be339 Cleanup: typos, copy/paste error 2025-09-23 09:42:48 +10:00
Campbell Barton
9ee1076fd4 Cleanup: warning from ruff 2025-09-23 09:41:14 +10:00
Campbell Barton
705c868bb9 Cleanup: trailing space 2025-09-23 09:37:03 +10:00
Lukas Stockner
78147b5db7 Cycles: Add Render Time pass
This implements a basic render time pass,
using HW-based counters to minimize render time impact.

x86-64 uses the TSC instruction for timing, while ARM64 uses the cntvct_el0
register. In theory TSC is not always super reliable (e.g. old CPUs had it tied
to their current clock rate), but for somewhat recent CPU models it should
be fine. If neither is available, it falls back to `std::chrono::steady_clock`,
which should still be very fast.

The output is in milliseconds of CPU-time per pixel.

Pull Request: https://projects.blender.org/blender/blender/pulls/125933
2025-09-22 21:54:08 +02:00
Jesse Yurkovich
12cdfb5856 Image: Log errors during image write when using OpenImageIO
Before this change, any accumulated errors from OpenImageIO would be
lost and a nonsensical use of `errno` would be used instead.

An example of the new error log:
```
00:23.188  image.write      | ERROR OpenImageIO write failed: sgi image resolution may not exceed 65535x65535, you asked for 65536x1
```

Pull Request: https://projects.blender.org/blender/blender/pulls/146554
2025-09-22 20:26:55 +02:00
Casey Bianco-Davis
0c3f633024 Fix #146510: Pen tool not working with Auto Keying
The problem was that the `Pen Tool` would not add keyframes when Auto
Keying was enabled.

This also fixes a crash that could happen when auto keying was enabled
and no keyframe existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/146549
2025-09-22 19:34:00 +02:00
Brecht Van Lommel
c857c9d4f5 Refactor: Move video CICP logic to be reusable for images
Ref #145612

Pull Request: https://projects.blender.org/blender/blender/pulls/146606
2025-09-22 19:20:42 +02:00
Brecht Van Lommel
f8e03daf37 Fix: Generated image checkboard colors too saturated with working space
Convert from Rec.709 to scene linear when generating these, to
match results in the default working space.

Pull Request: https://projects.blender.org/blender/blender/pulls/146603
2025-09-22 19:06:32 +02:00
Dalai Felinto
420dfebbb8 UI: Add Modifier: Move Geometry Nodes last
With Blender 5.0 a few modifier assets are bundled. This makes the
Geometry Nodes modifier even more of a special modifier which isn't
intended for many people to use.

As such this PR moves it to the end to be a bit less prominent.

| 4.5 | PR | PR |
| - | - | - |
|<img width="217" alt="Screenshot 2025-09-22 at 16.10.17.png" src="attachments/c12fedc4-549e-4b7b-bc28-c990e17a679e">|<img width="182" alt="Screenshot 2025-09-22 at 16.11.18.png" src="attachments/ce80702e-95dd-441a-8d36-c41f64d03a64">|<img width="214" alt="Screenshot 2025-09-22 at 16.11.45.png" src="attachments/5b07d5e9-b133-4fc5-a5a4-a1989929e58e">|

The PR column shows the changes proposed here in two scenarios: with and another without Unassigned assets.

Ref: !146590
2025-09-22 18:59:36 +02:00
Falk David
9aba62667a Fix: VSE: Missing updates when active scene differs from sequencer scene
This was caused by the fact that the sequencer scenes depsgraph was not
active.
There was no reason to not make it active, the original
PR (!140271) just missed this.

The issue became more apparent with !139634.

Pull Request: https://projects.blender.org/blender/blender/pulls/146605
2025-09-22 18:57:04 +02:00
Jacques Lucke
5ffc5df4f6 Geometry Nodes: support viewing non-geometry data with viewer node
As discussed in the last geometry nodes workshop, the viewer node now
needs the flexibility to handle new features: bundles, closures, and
lists. This PR takes the opportunity to add support for an arbitrary
number of items. Values are displayed directly in the node are all
displayed in the spreadsheet, where a new tree view allows selecting
which data to view, including nested bundles. Lists, single values,
bundle items, and closure signatures are all visualized in the spreadsheet.

We also prioritize the existing viewer behavior that views a geometry
together with a field, so various special cases are added in the viewer
activation to handle this.

Bundle hierarchies are displayed in the new tree view in the spreadsheet
sidebar. The spreadsheet itself just displays bundle identifiers, types,
and the contained values. Design wise, there might be more integrated
ways to present that hierarchy, but doing it in the tree view is a very
simple starting place.

Interactively added viewer node inputs are now removed automatically
if the link is removed. There is a new "Auto Remove" flag for each input
controlling this behavior. It can't be enabled for all inputs all the time
because then one couldn't e.g. setup the viewer node properly using
a script (which might add a few inputs first and then creates links).
Also when viewer items are added with the plus icon in the sidebar,
they are not automatically removed immediately.

https://code.blender.org/2025/07/geometry-nodes-workshop-july-2025/#view-any-data

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/144050
2025-09-22 18:08:45 +02:00
Bastien Montagne
849aba1ccf Core: Make ID::runtime an allocated pointer.
Will avoid having to reshuffle all ID types' DNA alignement when
modifying runtime data, avoid writing garbage data in blendfile, allow
usage of non-trivial C++ data in that runtime struct, etc.

NOTE: Trigger for this refactor was this commit in the upcoming packed
data PR (!133801):
https://projects.blender.org/blender/blender/commit/34a2ad81fbdcf7f

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146046
2025-09-22 18:02:32 +02:00
Brecht Van Lommel
fdc9412b9d Fix: Appending a workspace appends scene data along with it
This probably got broken when expanding was changed to use foreach ID. In the
old code the screen was not part of expanding.

Also adds the appropriate flags for workspace pinned and sequencer scenes.
This was causing issues in particular with the new video editing template, where
appending a workspace would append the Edit scene.

Fix #146156

Pull Request: https://projects.blender.org/blender/blender/pulls/146164
2025-09-22 17:40:38 +02:00
Dalai Felinto
851e5b55af VSE: Story Tools: Add Scene Strip Menu improvements
- Show unassigned scene assets directly under Assets.
- Use Icons for Assets label.
- Only show "Scenes" when there are Assets.
- Don't show scene assets on the "Scenes" list.

The design about changing the operator default behaviour will be
addressed separately. This patch only changes the UI.

Design ref: #145522
Ref: !146574
2025-09-22 17:19:03 +02:00
Bastien Montagne
4253687a9f Refactor: Use ID management API to delete temp preview render IDs.
`preview_id_copy_free` was trying to do its own version of
`BKE_libblock_free_data`, instead of calling directly that function.

This could easily lead to missing cleanup when modifiying ID management,
and since these IDs are managed by general ID API, there is no reason
not to do the same on destruction.

This is extracted from !146046 'making ID::runtime an allocated struct'.
2025-09-22 17:14:20 +02:00
Pratik Borhade
e6a3328da7 Nodes: UI: Show asset state icon in breadcrumbs
If nodegroup is linked or marked as asset, show different icons in breadcrumbs inside node space.

Note: Packed data-blocks have to be tackled separately since they are not in main yet (!133801).

Ref: !146573
2025-09-22 16:51:53 +02:00
Pratik Borhade
ed6caa5e80 UI: Pointcloud statistics
Show points/selected points of pointcloud in viewport and status bar.

Ref: !146129
2025-09-22 16:49:37 +02:00
Bastien Montagne
a6d2b21f3e Refactor: Minor changes to 'non-allocated' ID copying and related Depsgraph code.
Mainly:
- Move 're-used' ID reset from `BKE_id_copy_in_lib` to lower-level
  `BKE_libblock_copy_in_lib`.
- Remove call to `deg_tag_eval_copy_id` in `IDNode::init_copy_on_write`,
  as this is already done in `deg_expand_eval_copy_datablock` for all
  CoW IDs anyway (both re-used and newly allocated ones).

This is extracted from !146046 'making ID::runtime an allocated struct'.

Pull Request: https://projects.blender.org/blender/blender/pulls/146593
2025-09-22 16:40:38 +02:00
Tenkai Raiko
f8d579d153 Nodes: Add Radial Tiling Node
On its own, the main functionality of the Radial Tiling node
is the ability to divide a 2D Cartesian coordinate system into
as many radial segments as specified by the "Segments" input.
Each segment has its own affinely transformed coordinate system,
provided through the "Segment Coordinates" output, which can be
used to tile textures in a radially symmetric manner.

Additionally, a unique index is provided for every segment through
the "Segment ID" output, the width of each segment at Y-coordinate
of the "Segment Coordinates" output without normalization = 0 is
provided through the "Segment Width" output and the rotation value
of the affine transformation of the coordinate system of each segment
is provided through the "Segment Rotation" output.

The roundness of the coordinate lines of the "Segment Coordinates"
output can be controlled through the "Roundness" inputs.
This can be used to make the coordinate systems of the segments
a mix of Cartesian and polar coordinates.

Lastly, the lines of points of the "Segment Coordinates" output with
constant Y-coordinates have the shape of polygon with rounded corners,
which can be used to procedurally create rounded polygons.

Pull Request: https://projects.blender.org/blender/blender/pulls/127711
2025-09-22 16:02:37 +02:00
Philipp Oeser
af601e01fa Fix #145987: Brush selector available in Image Editor Mask mode
The keymap `km_image_paint` righfully includes both
`VIEW3D_AST_brush_texture_paint` and `IMAGE_AST_brush_paint` since
painting can be done in both Editors.

So we want to improve upon polling.

Three parent classes involved: `ImageAssetShelf`, `View3DAssetShelf`,
both inherit from `BrushAssetShelf`

`IMAGE_AST_brush_paint` (inherits from `ImageAssetShelf`) was already
checking for being in paint mode (so that Asset Shelf already wasnt
showing), but `VIEW3D_AST_brush_texture_paint` (inherits from
`View3DAssetShelf`) was permissive (doesnt have specialized poll, relies
on the "mother" classes `BrushAssetShelf` which only checks for an
active object and if that active objects `mode` equals the Assets Shelfs
"mode"). This can be true if you have an object in Texture Paint mode in
the 3DView.

So to make shelves like `VIEW3D_AST_brush_texture_paint` **not** pass
their poll in the Image Editor, add a specific poll case.

NOTE: the report also mentiones a crash when actually selecting a "bad"
brush from the "bad" asset shelf. Since that scenario is now impossible
to reach, the crash has not been investigated further.

Pull Request: https://projects.blender.org/blender/blender/pulls/146071
2025-09-22 15:56:52 +02:00