`GHOST_SwapWindowBuffers` doesn't fit well when using swapchains. In
that case an approach where swap chain images are acquired and released
would map better. This PR introduces `GHOST_SwapWindowBufferAcquire`
and `GHOST_SwapWindowBufferRelease` to be more in line with vulkan swap
chains.
Previous implementation would first record all GPU commands based on
the last used swap chain. In case a swapchain needed to be recreated
(window resize, move to other monitor) the recorded commands would
not match the swap chain and could lead to artifacts.
OpenGL only implements the release functions as they don't
have a mechanism to acquire a swap chain image. (Need to validate with
the Metal API how this is working and adapt is needed).
Currently when starting blender on a HDR capable display the first frame
would be based on an sRGB surface and presented on an extended RGB
(or other) surface. As these don't match the first frame could be incorrect and
also lead to UBs as another surface is expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/145728
This makes the shader node inlining from #141936 available to external renderers
which use the Python API. Existing external renderer add-ons need to be updated
to get the inlined node tree from a material like below instead of using the
original node tree of the material directly.
The main contribution are these three methods: `Material.inline_shader_nodes()`,
`Light.inline_shader_nodes()` and `World.inline_shader_nodes()`.
In theory, there could be an inlining API for node trees more generally, but
some aspects of the inlining are specific to shader nodes currently. For example
the detection of output nodes and implicit input handling. Furthermore, having
the method on e.g. `Material` instead of on the node tree might be more future
proof for the case when we want to store input properties of the material on the
`Material` which are then passed into the shader node tree.
Example from API docs:
```python
import bpy
# The materials should be retrieved from the evaluated object to make sure that
# e.g. edits of Geometry Nodes are applied.
depsgraph = bpy.context.view_layer.depsgraph
ob = bpy.context.active_object
ob_eval = depsgraph.id_eval_get(ob)
material_eval = ob_eval.material_slots[0].material
# Compute the inlined shader nodes.
# Important: Do not loose the reference to this object while accessing the inlined
# node tree. Otherwise there will be a crash due to a dangling pointer.
inline_shader_nodes = material_eval.inline_shader_nodes()
# Get the actual inlined `bpy.types.NodeTree`.
tree = inline_shader_nodes.node_tree
for node in tree.nodes:
print(node.name)
```
Pull Request: https://projects.blender.org/blender/blender/pulls/145811
It is possible for the simple vertex normal calculated during Paint
BVH normal updates to have a length of 0 if the connected faces cancel
each other out. This is a generally unlikely scenario, but will almost
always lead to further corruption of the mesh with the new normal.
If we detect this case, set the vertex normal to (0, 0, 1)
Pull Request: https://projects.blender.org/blender/blender/pulls/146004
Caused by NaN propagation. If a face becomes 0 area, the resulting
normal becomes a zero vector. This normal cannot be used to calculate
the distance to a plane.
To fix this case more generally, we clamp the strength to 1.0 at most
to avoid introducing scenarios where a given vertex can have a zero
vector normal.
Pull Request: https://projects.blender.org/blender/blender/pulls/145952
These `BLI_assert`s could be triggered by converting curves that were
already the desired type.
`curves.is_single_type` Checks if all of the curves are the desired
type, not if all of the selected curves are the type.
So the asserts can be triggered when only the destination type curves
are selected and other curve types exist.
Pull Request: https://projects.blender.org/blender/blender/pulls/145529
The "Mask" modifier didn't have a corresponding
RNA type.
The mask settings are already stored as part of the
`StripModifierData` which is probably why the type
was never added.
Nevertheless, having an RNA type means we can define
a UI name, description, and icon.
Pull Request: https://projects.blender.org/blender/blender/pulls/146039
This PR adds a check that batched tests do not surpass the Windows
command line limit of 32,767 characters (including the terminating null
character). This could previously happen if long path names were used.
Pull Request: https://projects.blender.org/blender/blender/pulls/145792
The root of the issue is that depsgraph relies on `ID::session_uid` to
identify and retrieve its own cached evaluation data for an ID,
including the memory for the evaluated ID data (e.g. used as keys to
retrieve IDInfo data stored in `DepsgraphNodeBuilder::id_info_hash_`).
This breaks in undo case, when a previously deleted ID is re-read from
the memfile, as it has not matching 'old' ID which address could be
reused. So while keeping its previous `session_uid`, it has a completely
new address, while the 'cow ID' retrieved from the depsgraph will still
have its `orig_id` point to the old address.
This commit fixes the issue by re-setting the `id_orig` pointer of the
`id_cow` evaluated data, when it already exists and is re-used.
This allows to keep the same `session_uid` for IDs on undo, even when
they are 're-created'. However, it is somewhat more risky than !146028.
Pull Request: https://projects.blender.org/blender/blender/pulls/146029
Always enforce tiling of some size, up to the 8k tile size.
Rendering very big images without tiles have a lot of challenges.
While solving those challenges is not impossible, it does not seem to
be a practical time investment.
The internals of the way how Cycles work, including Cycles Standalone
is not affected by this change.
A possible downside is that path guiding might not work exactly how one
would expect it to due to lack of information sharing across multiple
tiles. This is something that never worked nicely, and camera animation
and border render has the same issues, so it is not considered a stopper
for this change.
Fixes#145900
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146031
This was added for a fairly specialezed use case and is no longer being used
as far as we know. A future replacement would be to add a USD/Hydra procedural,
for which most of the groundwork already exists.
Pull Request: https://projects.blender.org/blender/blender/pulls/146021
These lines can be removed to avoid parsing them.
This allow to keep the same processing for shared host files.
Also removes a few lines of code to reduce the size of
shader sources.
This also contains a rewrite of the include parsing using
the shader parser.
Pull Request: https://projects.blender.org/blender/blender/pulls/146025
The tree-type argument for the `supports_socket_type` type should be
allowed to be anything. There doesn't seem to be a great benefit in
restricting it. Always returning false when the tree type is not supported
makes sense.
In addition it would also be good to double-check that one can't add
the bundle and closure nodes in the compositor yet. From my basic tests,
that seems to work as expected.
This adds a `VArray::from_std_func` next to the existing `VArray::from_func`. It
does almost the same but inserts some type erasure by using `std::function`
which avoids the need to instantiate the full virtual array. This has is a bit
slower at run-time, but in practice there are some cases where it doesn't
matter. Currently, this patch reduces binary size by ~35kb. Not too much, but
still good or such a simple change.
Pull Request: https://projects.blender.org/blender/blender/pulls/146011
This commit changes the Blender macOS bundle and blender-thumbnailer
app extension bundle Info.plist `CFBundleVersion` key to use the "short"
version string (X.X.X) instead of the "long" version string (X.X.X +
date), following the specs.[^1]
This fixes an issue with Xcode bundle archiving where the previous long
version would cause an error to be thrown during archive validation:
```
ERROR: [ContentDelivery.Uploader.6000007BD0C0] CFBundleVersion, “5.0.0 2025-09-09”,
must be composed of one to three period-separated integers. (-19239)
```
The previous "long" version string is still used by the `CFBundleGetInfoString`
key and thus still shows up in the application informations.
See Pull Request for app preview before/after screenshots comparaison.
[^1]: https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleversion?language=objc
Pull Request: https://projects.blender.org/blender/blender/pulls/146030
Expose the "Mute Links" add "Add Reroute" operator as active tools
in the node editor similar to the "Links Cut" tool.
This also works around #134153 by adding additional tools in the same
button group to the toolbar.
Pull Request: https://projects.blender.org/blender/blender/pulls/140429
The `eevee_render_to_image` can be called multiple time in the
case of multiview rendering.
To avoid the leak, free the previous instance before allocating
the new one. Reusing the instance doesn't seems to work here.
Another fix will follow this one to fix it more gracefuly.
This fix is kept simple for backporting purpose.
Pull Request: https://projects.blender.org/blender/blender/pulls/146015
There was a `Realized data in input geometry is ignored` warning when passing
gizmo data through instance-only nodes. This was because the node thought that
this data is "realized data" (like a mesh, curves, etc). This patch removes the
warning by making the check for realized data more precise.
Pull Request: https://projects.blender.org/blender/blender/pulls/146014
HIP-RT device:
- Add missing flags from the common flags query to the final compiler options
- Switch logging utility from printf to LOG_INFO_IMPORTANT
- Remove redundant compiler options already covered by common flags
HIP device:
- Add compiler command to logging
- Update C++ standard to C++17 to resolve compiler warnings
Pull Request: https://projects.blender.org/blender/blender/pulls/145284
Code was not guarding against missing `Editing` (like we usually do for
these situations).
This also corrects usage of `CTX_data_scene` (use `CTX_data_sequencer_scene`
where needed instead) which should be needed since 1122a05cb6
Pull Request: https://projects.blender.org/blender/blender/pulls/145908
Blade cursor patch #136749 cancelled select operations if the current
tool was the blade tool. This was to prevent LCS users from being able
to select handles when the blade tool would pass-through. This however
resulted in an RCS regression.
Fix instead by cancelling split if the mode is `use_cursor_position`
and there is no valid split, preventing a pass-through.
In RCS this works nicely because users can just select using right-click
and bypass split logic. In LCS this makes it impossible to select with
the blade tool enabled, but this is expected behavior as the blade tool
does not need strips to be selected to work anyways, and tools should
ideally have different, non-overlapping purposes. For instance, the slip
tool also does not affect selection logic.
(Note: there is one small caveat to this principle, which is that the blade
tool can't currently split connected strips together unless theyre both
already selected. This issue should be fixed with a future blade tool
refactor).
This also fixes unrelated bugs:
- Blade cursor no longer shows on first/last frames, where split point
fails
- You can no longer split in the gutters between channels
Pull Request: https://projects.blender.org/blender/blender/pulls/145938
This happened because it was attempted to access or set the
non- existent pixelspace offset of these audio strips. It is fixed by
applying the "paste at mouse" behavior only for strips that would be
rendered, which excludes sound strips implicitly. This has also
benefit, that strips with effects would only change position of the
effect thus avoiding double transformation.
Pull Request: https://projects.blender.org/blender/blender/pulls/145819