Commit Graph

152346 Commits

Author SHA1 Message Date
John Kiril Swenson
28ff392b19 Fix: VSE: Copy to selected would interfere with dual handles
After #139075, since dual handle translation always selects two strips
at a time, any later handle movement on one of the strips would affect
both, which is unintuitive and likely not what the user intended.

We can fix this for now by checking for strips that directly border one
another and removing them from the `copy_to` list.

But in the future, if we change selection logic so that strip and handle
selection states are mutually incompatible, we could also fix this by
making sure that dual handle tweaking only selects the handles and not
the strips themselves.

Pull Request: https://projects.blender.org/blender/blender/pulls/142916
2025-07-24 20:12:03 +02:00
Clément Foucault
1611dc2fb3 GPU: Rever mass renaming removing GPUTexture type from python
This was accidentaly commited in 32d64d35bb
2025-07-24 18:19:59 +02:00
Brecht Van Lommel
47f9b7a98e Fix #142022: Cycles undisplaced normal not available
Previously with adaptive subdivision this happened to work with the N
attribute, but that was not meant to be undisplaced. This adds a new
undisplaced_N attribute specifically for this purpose.

For backwards compatibility in Blender 4.5, this also keeps N undisplaced.
But that will be changed in 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/142090
2025-07-24 18:16:25 +02:00
Sean Kim
97a5e2ea1b Fix #142963: Crash when using Texture Paint sample color
Introduced in d0b749beb8

Pull Request: https://projects.blender.org/blender/blender/pulls/143015
2025-07-24 16:35:05 +02:00
Germano Cavalcante
cb51fc5471 Fix #141741: Combed particles are affected by occlusion of other particles
Caused by 7688677e29, which replaced `DRW_draw_depth_object` with
`DRW_draw_depth_loop`.

`DRW_draw_depth_object` simply rendered the object without actually
using the DRW manager capabilities.

Now, with `DRW_draw_depth_loop`, the depth is rendered based on what
the engine sees with overlays disabled, which doesn't hide the
particles.

The solution to this issue is to skip particle rendering in the overlay
engine in `DRW_draw_depth_loop`.

Co-authored-by: Miguel Pozo <pragma37@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141981
2025-07-24 16:24:19 +02:00
Hans Goudey
4f372d64d4 Geometry Nodes: Initial very basic list support
This includes a new list structure type and socket shape, a node
to create lists, a node to retrieve values from lists, and a node to
retrieve the length of lists. It also implements multi-function support
so that function nodes work on lists.

There are three nodes included in this PR.
- **List** Creates a list of elements with a given size. The values
  are computed with a field that can use the index as an input.
- **Get List Item** A field node that retrieves an element from a
  a list at a given index. The index input is dynamic, so if the input
  is a list, the output will be a list too.
- **List Length** Just gives the length of a list.

When a function node is used with multiple list inputs, the shorter
lists are repeated to extend it to the length of the longest.

The list nodes and structure type are hidden behind an experimental
feature until we can be sure they're useful for an actual use case.

Pull Request: https://projects.blender.org/blender/blender/pulls/140679
2025-07-24 16:16:40 +02:00
Brecht Van Lommel
ba46217b51 Fix: GPU shader error logging doesn't show shader name or stage
This was relying on the souce file and line printing which is now disabled
by default. Also log the shader source without indent for readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/142882
2025-07-24 16:10:19 +02:00
Hans Goudey
9c9695b103 Refactor: Move ReportList definition from DNA to blenkernel
Ever since [0], ReportList is not actually used in any DNA structs.
That makes sense, since reports are conceptually only necessary
at runtime. Move the definition of the struct to BKE_report.hh, and
fix a bunch of include errors where types were previously available
transitively. Besides adding some clarity, theoretically this change
could reduce compile times because of less header parsing.

[0]: 1bf6d8b0b9

Pull Request: https://projects.blender.org/blender/blender/pulls/138872
2025-07-24 15:59:52 +02:00
Hans Goudey
623d3c04e2 Fix: Set Mesh Normal "Tangent" mode fails with free normals
If free normals already exist, the `custom_normal` attribute already
exists with a different type, so the attribute writer is not created
properly in `mesh_set_custom_normals` and the process fails. Instead,
setting tangent space custom normals should clear existing free normals.

Pull Request: https://projects.blender.org/blender/blender/pulls/142961
2025-07-24 15:50:40 +02:00
Brecht Van Lommel
264669fc03 Fix #142953: Cycles renders world lightgroup wrong
Pull Request: https://projects.blender.org/blender/blender/pulls/143003
2025-07-24 15:24:03 +02:00
Campbell Barton
9a6d95600d Cleanup: use define for action group name size 2025-07-24 22:18:15 +10:00
Campbell Barton
9b05a00b50 Cleanup: use UTF8 string copy for bActionGroup::name
Avoid potential incomplete UTF8 byte sequences.
2025-07-24 22:18:15 +10:00
Campbell Barton
bc69b25382 Cleanup: use UNLIKELY(..) for integer overflow checks 2025-07-24 22:18:15 +10:00
Campbell Barton
21d431d214 Cleanup: minor clarifications for View2D struct members
Avoid including multiple members in one doc-string.
2025-07-24 22:18:14 +10:00
Clément Foucault
475b20fc5d Refactor: GPU: Use macros for TextureFormat conversions
This reduces the risk of errors and code duplication.

Rel #130632

Pull Request: https://projects.blender.org/blender/blender/pulls/142898
2025-07-24 13:56:41 +02:00
Jesse Yurkovich
e739f99468 Fix #110334: int overflow in rna_iterator_array_begin
The calculation for `endptr` would overflow when multiplying `length`
and `itemsize`. A similar issue was spotted for `rna_array_lookup_int`.

Ref !141061
2025-07-24 21:46:14 +10:00
Omar Emara
e34e6373b6 Compositor: Replace Composite node with Group Output node
This patch replaces the Composite node with the Group Output node as the
primary compositor output. The old node was removed and versioned. This
was done for consistency with Geometry Nodes and in preparation for more
generic use of the compositor in VSE modifiers, layered compositing, NPR
multi-stage compositing, and more.

The Group Output node relies on the node tree interface, so we now have
a default interface of a single input and a single output. For now, only
the first input is considered while the rest are ignored, just like the
Geometry Nodes design. Furthermore, the input is required to be of type
color. Warnings and errors are issues if any of those are not met, also
similar to Geometry Nodes.

This introduces a new limitation: Composite outputs can no longer exist
in node groups, since they obviously then act as their respective group
outputs.

A refactor for the compositor scheduler is needed to simplify the logic
after this change, but this will be done in a separate patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/142232
2025-07-24 13:41:56 +02:00
Jonas Holzman
d95c2bc406 GHOST: Rename Metal Context from ContextCGL to ContextMTL
This commit renames the GHOST Metal graphic context class and related
files / references from `GHOST_ContextCGL` to `GHOST_ContextMTL`. When
the Metal backend was first introduced, this context file contained
both the old OpenGL context (CGL, for macOS Core OpenGL API), and the
newer Metal context. Since #110185 all CGL related code was removed
from the class, making it Metal only, and thus rendering the old class
name outdated and potentially misleading. In addition to the rename,
unused OpenGL related forward declarations and old TODOs were also
removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/142519
2025-07-24 13:28:44 +02:00
Michael Jones
f3485cc925 Cycles: MetalRT: Only use extended limits if needed (revisited)
Currently MetalRT renders always use extended limits, which is needed to correctly render scenes where the max primitive count can exceed 2^28 or the instance count can exceed 2^24. This patch adopts Metal best practices of only enabling this flag if it is needed.

This PR is similar to #133364, but there are some notable differences:

1) The old PR made an overly optimistic assumption that all the relevant visibility bits could be squeezed into 8 bits. This new PR adopts the same approach that Optix takes of using 8 bits as a primary HW filter, and checking the full 32 bit mask inside the SW intersection handler.

~~2) I moved the scene scanning check from Scene into MetalDevice. This avoids platform specific details leaking into platform agnostic areas.~~

~~3) In live viewport mode, we always use extended limits in case we tip over the threshold.~~

_EDIT:_
2) The limits are scanned in `Scene::update_kernel_features`, and given to the device by a new `set_bvh_limits` method which returns true if the BVH and kernels need to be reloaded.

Pull Request: https://projects.blender.org/blender/blender/pulls/142401
2025-07-24 13:27:20 +02:00
Omar Emara
dffb8366e0 Fix #142954: Crash when opening file with undefined Translate node
Blender crashes when opening a file with undefined Translate nodes due
to a missing storage. The crash happens during versioning, as the nodes
are not yet undefined at this point. To fix this, we make the versioning
code more corruption proof and skip versioning nodes with no storage.

Pull Request: https://projects.blender.org/blender/blender/pulls/143055
2025-07-24 12:53:55 +02:00
Thomas Dinges
e85de7a26b Builds: Remove macos_x64 submodule from git 2025-07-24 12:52:05 +02:00
Clément Foucault
b6076e4d80 GPU: Add procedural drawcall in gpu::Batch
This allows to store a number of vertex to draw
per batch without specifying any attribute.

This allows to create batches that are empty but
still holds the amount of geometry to produce.

Needed for new curve drawing #142969.

Pull Request: https://projects.blender.org/blender/blender/pulls/143052
2025-07-24 12:27:10 +02:00
Christoph Lendenfeld
614b6508d4 Anim: Add copy to selected for shapekeys
This adds copy to selected support for Shape Keys.
That means Alt+drag on a property influences all selected.
Also the copy to selected operator is now available in the context menu.

Part of #136838

Pull Request: https://projects.blender.org/blender/blender/pulls/138611
2025-07-24 12:20:10 +02:00
Clément Foucault
50e876f21d EEVEE: Add correct volumetric support for point clouds
Since 4.5 the point clouds are out of experimental.

The drawing of pointcloud did not allow for correct volume
estimation as the shape are not rendered as closed objects
(i.e. the backfaces were not rendered).

This patch renders the backfaces for the volume occupancy
pass by rendering the pointcloud twice and flipping the
shape alignment matrix. This reverse the winding and
does a backface hit as it would do for a sphere primitive.

This solution even if not perfect avoids adding more
geometry in the Index Buffer. The geometry approach might
be preferable in the future if we find a way to render
the spheres without an IBO or with a JIT generated IBO.

Rel  #141490

Pull Request: https://projects.blender.org/blender/blender/pulls/142095
2025-07-24 12:05:29 +02:00
Clément Foucault
34e176d255 Fix #138191: EEVEE: Bump is incorrect with pixel size greater than 1x
This was caused by the hardware derivatives output being affected
by render resolution. Scaling them back to the full resolution
value fixes the issue.

This also fixes the Wireframe node that also relies on derivatives.

Pull Request: https://projects.blender.org/blender/blender/pulls/142101
2025-07-24 12:04:15 +02:00
Omar Emara
b0db491f24 Fix: Crash when versioning Translate node
Blender crashes when versioning the Translate node due to a nullptr
storage. This happens due to an inverted nullptr check.

Additionally, we remove redundant assignments from other versioning code
for safety.

Pull Request: https://projects.blender.org/blender/blender/pulls/143046
2025-07-24 11:56:07 +02:00
Habib Gahbiche
25d4ac38b1 Tests: Compositor: add UI test case for undo
Support the compositor in UI tests and add an undo test case involving
a compositing node tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/140595
2025-07-24 11:41:46 +02:00
Philipp Oeser
c1df8404e7 Fix #142839: Asset Browser: Copy to Selected on MetaData broken
It was not taking into account actual selection in the asset browser
("selected_assets"), thus failing in bringing things over.
To resolve, add a case for `RNA_AssetMetaData` in
`UI_context_copy_to_selected_list`.
Since "selected_assets" will give us `AssetRepresentation`, we need to
remap to `AssetMetaData` to get this working.

Pull Request: https://projects.blender.org/blender/blender/pulls/142862
2025-07-24 11:32:16 +02:00
Jacques Lucke
70b956ba53 Fix: Nodes: memory leak in extra info tooltips
The issue was that the tooltip function arguments were sometimes allocated but
not freed. The solution is to handle the lifetime of the argument better. The
code now makes a copy of the argument when it's passed to a layout function. In
an idea world, one could just use something like `std::function` instead of
manual memory management, but the API does not support it yet.

This was caused by f3a1d8fad5.

Pull Request: https://projects.blender.org/blender/blender/pulls/143043
2025-07-24 10:35:47 +02:00
Campbell Barton
0442a9fe0a Extensions: clarify the identifiers must "Python" id's in the error
Without this, it's not clear what a "valid identifier" means,
ref: #136517.
2025-07-24 18:29:36 +10:00
Brady Johnston
6f2988f0af Nodes: support interface items lookup by Identifier
Currently, the `NodeTreeInterface` only allows lookup via the item names, and not
their identifiers. This is problematic when there are multiple items with the
same name, they can only be selected via index and not name / identifier.

The following examples are done on a default Geometry Nodes tree that just has a
`Geometry` input and `Geometry` output.

Pull Request: https://projects.blender.org/blender/blender/pulls/140196
2025-07-24 10:25:35 +02:00
Jacques Lucke
6ca5c0fa92 Fix #142290: crash pasting linked ID in its source library
The core issue here seems to be that the pasted object is turned into an Empty
but it still has all the modifiers. Later when the object is copied by the
depsgraph, the modifiers are not copied along, confusing some code.

Right now, this patch is rather defensive, so it solves the specific crash and
maybe similar cases that could come up in the future. One could separately also
clear all modifiers when turning the object into an Empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/143029
2025-07-24 10:22:47 +02:00
Jacques Lucke
df625835c4 Fix #142202: missing anonymous attribute propagation when using some field nodes
Some fields were missing `for_each_field_input_recursive` implementations which
are required for anonymous attribute propagation to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/143031
2025-07-24 10:16:46 +02:00
Aras Pranckevicius
ea9b520a39 Fix: assert in image Luma vectorscope
Commit 9e221a10d3 made it so that IMM shader is unbound
while drawing a scope, and added assert to ensure it is unbound.
But it missed one place where waveform_draw_one is used, and did
not unbind the IMM shader around that.
2025-07-24 10:43:25 +03:00
Alaska
8a6d706d77 Utilities: Add batch files to help launch Blender with different GPU backends
With Vulkan now having general feature parity with OpenGL, but with
some stability issues, it has become more important to offer ways for
users to quickly launch Blender with the OpenGL or Vulkan backend
in case Blender is unable to open with one of them.

This commit adds three new batch files to help with this:
- `blender_factory_startup_vulkan.cmd`
  - Launches Blender with factory settings, but with Vulkan enabled.
    Useful for helping test if a Vulkan crash at startup is related to
    a addon.
- `blender_startup_opengl.cmd`
  - Simply launches Blender with the OpenGL backend. It does not change
    any other settings. Useful in case a user has complex user
    preferences, enabled Vulkan for testing, and now Blender crashes on
    startup. Now they want to switch back to OpenGL and they don't want
    to lose their complex user preferences by using
    `blender_factory_startup.cmd`
- `blender_startup_vulkan.cmd`
  - Simply launches Blender with the Vulkan backend. It does not change
    any other settings. Useful for people that encounter #127835 after
    a Windows update. This issue can be worked around by using Vulkan.
    But if you are experiencing the issue and are on the OpenGL
    backend, you can't use the Blender interface and so you can't
    easily switch to the Vulkan backend without the command line
    or a script like this.

Pull Request: https://projects.blender.org/blender/blender/pulls/142169
2025-07-24 09:15:52 +02:00
Aras Pranckevicius
71ad809bbe Fix #141095: VSE thumbnails drift horizontally when resizing the timeline vertically
Looks like almost everywhere else, the v2d mask size is calculated
as "v2d->mask size plus one". This is the zoom ratio that the V2D
resizing tries to keep constant, etc.

However the VSE timeline drawing code, when calculating the pixel
scaling factors, used the v2d->mask size without adding +1.
This resulted in a very slight zoom ratio change when resizing the
timeline area, which is made larger because thumbnails are often more
wide than narrow, and many of them are laid out next to each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/142952
2025-07-24 08:52:44 +02:00
Aras Pranckevicius
09a47a9a88 Cleanup: remove manually-ran IMB_performance_test
The performance test was added in 6d93bf6b44, but I don't think
anyone has ever ran it since then. And due to how IMB library
depends on BKE, this drags in "almost all of blender" into the test
executable, resulting in non-trivial link times that everyone
pays for. Just remove it.
2025-07-24 09:51:00 +03:00
Jesse Yurkovich
cd6c338ba5 Fix #142972: FBX/USD import crash filling shape key data on empty mesh
The call to `BKE_keyblock_convert_from_mesh` can leave the KeyBlock's
data field null if the passed in mesh has no verts.

Continue to allow the shape keys to be created, but do not attempt to
actually fill them in with data. This seems to match the old FBX
importer's behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/142995
2025-07-24 08:43:14 +02:00
Aras Pranckevicius
0347e72778 Cleanup: fix compile warning 2025-07-24 09:37:46 +03:00
Mattias Fredriksson
1affb8de2f Cleanup: simplify OBJ export_frame() into separate functions
Separates export_frame() into individual functions for opening file streams
and writing .mtl and .obj data. This makes the code clearer in what and when
data is written to each stream by not interleaving .obj/.mtl writing. It also
simplifies the logic by separating out handling/branching for file streams
and .mtl writing.

Pull Request: https://projects.blender.org/blender/blender/pulls/142918
2025-07-24 08:34:21 +02:00
Jacques Lucke
a57709ca25 Fix #142828: broken socket usage inference for some nodes
The issue was an oversight in f7f18cd0c7.

This patch also adds some unit tests that would have caught this error.

Pull Request: https://projects.blender.org/blender/blender/pulls/143026
2025-07-24 08:13:34 +02:00
илья _
e15537c049 Nodes: clamp new node starting position to region bounds
Simular to #141838.

Trivial clip of top left node corner to area of editor +-10% at all sides.

Pull Request: https://projects.blender.org/blender/blender/pulls/142479
2025-07-24 07:43:48 +02:00
Campbell Barton
ea99acb6a2 Fix #107021: Knife cursor lost after status bar pan
Check the modal cursor isn't set before overwriting it for 2D viewport
operators.

Match behavior for image & movie-clip navigation.
2025-07-24 04:37:34 +00:00
Campbell Barton
c1b2a1af74 Cleanup: quiet unused warnings 2025-07-24 14:37:28 +10:00
Campbell Barton
c3b8702466 GHOST: ignore GHOST_ASSERT in release builds
Error in [0] made GHOST assert in release builds.

[0]: 4d227dd593
2025-07-24 01:10:25 +00:00
Campbell Barton
f256e7141a Cleanup: use '*' prefixed multi-line comment blocks 2025-07-24 10:48:04 +10:00
Campbell Barton
d5cbc79982 Cleanup: format 2025-07-24 10:28:21 +10:00
Aaron Carlisle
29b3679b10 Fix: UI Use title case for property text
Reported in blender/blender-manual#105127
2025-07-23 20:16:52 -04:00
Jesse Yurkovich
b248c83027 USD: Remove the export_textures export operator property
This property was superseded by the `export_textures_mode` property in
Blender 4.3 where we left the old property in place to prevent breaking
changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/142740
2025-07-23 22:08:43 +02:00
Jacques Lucke
f50699d80a Refactor: Geometry Nodes: use a single string identifier for closure/bundle items
Previously, we used `SocketInterfaceKey` as identifier for bundle and closure
items. It contained multiple identifiers (although only one was ever used so
far). The idea was that multiple identifiers could provide more flexibility.
E.g. an Evaluate Closure node could work with closures with slightly different
identifier names, or a bundle could be passed into different systems that expect
the same data but named differently.

The added complexity by allowing for this is greater than I anticipated even
though most places didn't even support multiple identifiers yet. In addition to
that, it seems like there may be simpler workaround for many situations where
multiple identifiers were supposed to help. E.g. one could just add the same
value to a bundle twice with different names or one can build a node group that
maps a bundle for one system to one for another system.

Overall, the complexity of `SocketInterfaceKey` didn't seem worth it, and we can
probably just build a better system when we don't allow multiple identifiers per
item.

Pull Request: https://projects.blender.org/blender/blender/pulls/142947
2025-07-23 21:26:51 +02:00