Currently the realize instances code (which is also used by the join
geometry node) always creates generic attributes instead of vertex
groups. The expectation was that vertex groups would be replaced
by some form of generic attribute sooner rather than later. However,
it's clear that won't happen for some time, and this issue causes users
a lot of trouble. This commit preserves the vertex groups through the
operation. Any attribute name that was a vertex group on any of the
input meshes will become a vertex group in the result.
In the code this is a simple change because the attribute writer
abstraction allows writing to vertex groups as if the were just like
other contiguous arrays. In the future we could optimize the code
specifically for vertex groups.
This resolves the "bug" part of #99197 where the nodes remove vertex
groups. However, this doesn't change the fact that generating
primitive meshes in geometry nodes won't create vertex groups.
In general the property editor settings on the original mesh have
no effect on meshes created from scratch in geometry nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131692
`.release()` is technically fine but semantically wrong here. First,
release is meant to take ownership from the unique_ptr, meaning
at best it's "weird" to not do anything with the pointer afterwards.
Second, the runtime struct with the unique_ptr was just default
constructed, which means the unique_ptr will be empty anyway.
The cause is numerical issues with `fast_sinf()`. While fixing
`fast_sinf()` would ultimately fix the problem, it involves more
complications in other code paths, and it is safer to clamp the
integration range anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/131689
When pressing Tab to move to the next input in the same block (and
Alt-Tab to move backward), we currently skip buttons that have the
UI_BUT_DISABLED flag. This PR makes these operations also skip buttons
that have UI_HIDDEN. This makes tabbing work better in places like the
color picker where we show/hide the RGB and HSV buttons depending on
mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/131698
The tooltip used to say that the center is always the objects origin.
However, in the case of text-boxes, it's actually the center of the text box.
There might be valid use-cases to move the text box center to the
object's center, but it seems like the same can be achieved with offsets.
Also that would be a new feature that's out of scope of a bug report.
Pull Request: https://projects.blender.org/blender/blender/pulls/131693
Changing Icon Alpha in Preferences / Themes / User Interface / Styles /
Icon Alpha is meant to change the opacity of the UI icons. It should not
change the opacity of the previews of Matcaps and Studio lights as this
changes the color because of mixing with the background. This PR just
skips this icon type when changing the alpha for this preference.
Pull Request: https://projects.blender.org/blender/blender/pulls/131690
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.
Some changes to how argparse is used in render tests:
1. Use the common approach of one dash for single-letter options (`-b`)
and two dashes for longer options (`--blender`). In this commit that
just means changing single-dashed (`-testdir`) to double-dashed
(`--testdir`).
2. Remove unnecessary `nargs` arguments. The code was telling `argparse`
to put CLI arguments into a list of one item, and then had code to
turn that one-item list into the item itself. I've just removed the
`nargs` argument altogether, as that just produces the desired
value without requiring more code.
I've also removed `nargs="+"` from the handling of the `--blender`
parameter, as that allowed for multiple occurrences of `--blender
{path}` but was silently ignoring all of those except the first.
To ensure that required arguments are present, the code now uses
`required=True` instead of `nargs`.
3. Add a `description` parameter so that `--help` shows what the
test script actually does. Also it helps people (like me) who want
to figure out which blend file is actually being opened by the
test, without making the test itself more verbose.
No functional changes, except that you now cannot add multiple
`--blender` arguments any more (the CLI invocation will fail). This wasn't
used anywhere I could find, though.
Pull Request: https://projects.blender.org/blender/blender/pulls/131666
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