This avoids assuming that `BKE_ntree_update_main` has run on a node tree before
the depsgraph is build. The update code already finds the dependencies to
determine if a relations update is necessary or not. To avoid detecting these
dependencies again (which requires iterating over all the nested nodes), they
were cached on the node group so that they can be used when the depsgraph is
build.
However, since the update code does not run in all necessary cases yet
(#131598), this does not work currently. This patch fixes the situation by
removing the optimization of not having to find all dependencies again when the
depsgraph is build.
This optimization can be introduced again after we can be more sure that the
node tree update code runs whenever the node tree changes (which is what #131665
tries, but requires more discussion).
Pull Request: https://projects.blender.org/blender/blender/pulls/131685
This improves the `write_libraries` function in a couple of ways:
* No need to split the `bmain` which I find somewhat hard to reason about. I
think it's good if `bmain` is as read-only as possible in this write-context.
Instead a more explicit C++ data structure (`MultiValueMap<Library *, ID *>`)
is used. I think this was the only place in write-code that used
`blo_split_main`.
* Deduplication of the check that determines whether a placeholder should be
written for a specific ID.
* General cleanup to avoid unnecessarily deep nesting when iterating over IDs.
No functional changes are expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/131385
Use the same workaround as for render.
Wrap the sync inside its own `custom_pipeline_wrapper` so that
we don't freeze the main thread when waiting for these 50ms.
Also remove the `manager->begin_sync()` and `manager->end_sync()`
as they are already present inside `render_sync`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131678
There could be strokes that have zero lengths (a dot), in this case a
NaN factor was given to the final build function, leading to invalid
index when accessing arrays. Now `get_stroke_factor` will return either
0.0f or 1.0f (depending on input factor) when stroke has zero total
length.
Pull Request: https://projects.blender.org/blender/blender/pulls/131683
NVIDIA driver before 550 doesn't work as expected on Linux. The issue is
known on the internet, but no real solutions are provided.
This change will limit the block list of older driver to the Linux
platform only. It has been reported that Windows these driver are
working and would enable older GPUs to work on Windows.
Ref #129160
Pull Request: https://projects.blender.org/blender/blender/pulls/131674
This patch optimizes the constant bokeh blur CPU implementation by
pre-computing the blur kernel from the bokeh kernel, and thus avoid
interpolation in the blur loop. Gives a 2x improvement.
In Blender 4.2 in Grease Pencil draw mode it was possible to
erase strokes using box and lasso gestures.
Under the hood, these were just using the selection operators
that had special deletion handling if the object was in draw mode.
Rather than hacking this into the selection operations, this adds
two new operators:
* `grease_pencil.erase_lasso`
* `grease_pencil.erase_box`
When using one of the erase operations with auto-key, the previous
keyframe will be duplicated to the current frame (for the drawings
that are affected by the eraser).
They are mapped to the same shortcuts than the selection
operators in Blender 4.2.
* Lasso erase: `Ctrl`+`Alt`+`RMB`.
* Box erase: `B`.
This is part of #130518.
Pull Request: https://projects.blender.org/blender/blender/pulls/131504
Depth of field attaches the half res and scene color texture, but
doesn't provide the correct usage flags. This resulted in validation
errors in Metal & Vulkan.
Pull Request: https://projects.blender.org/blender/blender/pulls/131655
Vulkan version 1.2 supports Workgroup execution model. Vulkan 1.3
introduced the LocalSizeId execution model and has been backported in
the VK_KHR_maintenance4 extension. In future SPIR-V versions the
Workgroup execution model will be deprecated.
This PR checks the availability of VK_KHR_maintenance4 extension and
when enabled compile the shaders towards Vulkan 1.3. This would
automatically use the LocalSizeId execution model.
See https://registry.khronos.org/vulkan/specs/latest/man/html/WorkgroupSize.html
Pull Request: https://projects.blender.org/blender/blender/pulls/131663
Edit mode for curves and Grease Pencil was using the plain object transform for
all points without support for individual crazyspace transforms. This patch adds
support for the local rotation matrices, so editing curves on top of modifiers
converts offsets into original geometry space.
For Curves objects these matrices are currently only computed by the surface
deformation node, so editing on top of a surface deformation is the only case
that works currently.
For Grease Pencil the armature modifier is supported and more should be added
in future (see overview task #131599).
Pull Request: https://projects.blender.org/blender/blender/pulls/131619
When using a texture as attachment it must be created witht the
GPU_TEXTURE_USAGE_ATTACHMENT flag. If this is not the case it would lead
to incorrect usage in Vulkan. This change adds asserts to detect
incorrect usage.
Pull Request: https://projects.blender.org/blender/blender/pulls/131656
Commit 073ce98231 back in 2016 changed white balance math to do
a pow based pixel operation instead of multiplication. However
pow on negative numbers (which would happen on any HDR input) is
undefined. Until some better math is decided upon, at least ensure
the input is not negative.
GPU_texture_clear was only used for clearing color textures, but that
changed recently. This PR adds supports for clearing depth/stencil
textures using GPU_texture_clear.
Pull Request: https://projects.blender.org/blender/blender/pulls/131653
Depth 24 stencil 8 texture could not be cleared directly. Recently
GPUViewports clear their attachments when created. This resulted into
non consistent behavior between backends.
This change adds support to clear depth 24 stencil 8 textures using
`GPU_texture_clear`. The implementation currently assumes that the input
value is a float.
Pull Request: https://projects.blender.org/blender/blender/pulls/131650
When handle tweaking is enabled and strips are short, hovering over them
would trigger assert in `mouseover_strips_sorted_get()`, because more
than 2 strips would be picked. Sorting was done just by swapping strips
if order was incorrect
Use `std::sort()` instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/131594
First the normal mode was changed, then the custom normal input was
evaluated. That's incorrect because changing the normal mode changes
the output of the normal mode. The fix is to avoid changing the normal
mode until after the normals are calculated.
Some Status Bar icons differ in width, like "Ctrl". For these items we
have to add a spacer before the next item. Unfortunately there is one
code path where this does not happen for modifiers even though it does
for the main icon. This PR fixes this and removes the chance of icons
overlapping on the status bar.
Pull Request: https://projects.blender.org/blender/blender/pulls/131584
For a bit of (somewhat related) history, check 8d590e4b86.
The real problem here is that for non square images, the
`applyAspectRatio` works with "wrong" vectors if translation constraints
(`CON_APPLY`) are used. Then, the passed vector might actually have axis
changed, e.g. constraining to the Y axis does not hold the Y translation
value in dvec[1], but in dvec[0]. This is expected by design, but
`applyAspectRatio` is not aware of this and does wrong things.
The easy way around this is to actually call `applyAspectRatio` before
the `CON_APPLY` stuff takes place.
NOTE: future improvement might be to split (or rename)
`removeAspectRatio` / `applyAspectRatio` becaues these functions also
handle the "conversion" to pixel values which is not obvious atm.
Pull Request: https://projects.blender.org/blender/blender/pulls/131608
Regression from #131134.
The shader still reads `vel.obj.ofs[STEP_NEXT]` even when in the
viewport.
- Ensure that `vel.obj.ofs[STEP_NEXT]` points to a valid memory
location even if the computed value is still wrong.
- Ensure that the viewport always uses a 2 channel vector_tx and all
texture reads are always swizzled.
This also seems to fix the motion vector pass for the realtime compositor.
Pull Request: https://projects.blender.org/blender/blender/pulls/131445
The layer mask used by the armature modifier can be incomplete, in which case
the indices may not match the edit hints list of layer data. The actual
layer index must be used instead.
Also fixes a build error on Win64 ARM which cannot compile a parallel_for_each
over an index range.
Pull Request: https://projects.blender.org/blender/blender/pulls/131620
The Translate node leaks memory when no realization happens. That's
because the code passes the input through, then passes it again inside
the transform algorithm. To fix this, remove the pass through in the
node code and leave potential pass through to the algorithm.
Workbench shaders uses one fragment shaders, but uses different
resources based on the step of the effect. This failed in vulkan as all
defined resources should be found. This PR separates the steps in its
own fragment shader and adds sampler binding per step.
- Removed the max coc input texture as it wasn't used.
- Removed the background texture as it wasn't used.
- Renumbered the resources.
Pull Request: https://projects.blender.org/blender/blender/pulls/131606
The issue was that the `handle_left`, `handle_right` and `position` attribute
are updated one after another and the input field is evaluated again for each
attribute. If the handle positions are updated first, then the tangent will
change in consecutive evaluations.
The fix is to set the three attributes at the same time and to evaluate the
inputs only once.
Pull Request: https://projects.blender.org/blender/blender/pulls/131609
With Slotted Actions, an Action's `idroot` should always be zero,
corresponding to "unspecified". However, there was still some old
leftover code that, when duplicating an Action via the Action Editor,
would set the new Action's `idroot` to either OB or KE, depending
on the editor mode.
In addition to now being incorrect, this was also tripping an assert
elsewhere in the code when trying to then assign that duplicate action
to an ID.
This commit simply removes the outdated code, which is no longer needed,
leaving the `idroot` as the default (unspecified).
Pull Request: https://projects.blender.org/blender/blender/pulls/131601
The generic Action assignment function tries to find a slot to
auto-assign. This would always look at the last-used slot identifier on
the ID's `AnimData` struct, even when assigning to an NLA strip or
Action constraint.
This commit removes the `Action::find_suitable_slot(ID)` method, and
replaces it with a `generic_slot_for_autoassign(ID, action,
last_slot_identifier)` function. That function basically copies the
behaviour of `find_suitable_slot()`, except that it gets the
`last_slot_identifier` from the caller.
Another difference is that it no longer checks whether the Action is
already assigned, and so also never uses the currently-assigned slot
handle. In the only code flow that calls `generic_slot_for_autoassign()`
this situation would never occur, and thus it's better to delete this
dead code.
Pull Request: https://projects.blender.org/blender/blender/pulls/131491