The issue is due to a null pointer dereference in the call to
`IMB_colormanagement_srgb_to_scene_linear_v3` in
`vpaint_get_current_col` in `paint_vertex.cc`.
`BKE_paint_brush_for_read` returns a null pointer and as a result
`brush_color` points to the zero page, thus causing a null pointer
dereference and hence the access violation exception.
Normally, users should not be able to have no brush selected inside
vertex paint mode. Instead of adding null checks everywhere, this
commit protects against this case by switching the poll method to
check for a brush before allowing execution.
Pull Request: https://projects.blender.org/blender/blender/pulls/128260
This patch adds an `Integer` type to the Value to String node.
This allows for converting integer inputs into string outputs without
any loss of precision. Something which the original implementation is
not able to do.
This issue becomes evident at values greater than `2 ^ 24` or
`16,777,216`, where the precision loss is high enough that the float
implementation starts skipping certain integers.
Pull Request: https://projects.blender.org/blender/blender/pulls/128362
New editor highlighting (#116684) will sometimes highlight a nearby
area when hovering over the Top Bar. This is caused by the use of the
top-left corner for testing. This just uses the region midpoint
instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/128394
When attempting to load a blend file that is not found or otherwise
invalid we are currently showing an (ugly) popup menu report and then
clearing the item from the Recent Files list. Clearing the list could
be unwanted in the case of files that are temporarily offline. And we
now have the ability to only clear "Items not found" using the "Clear
Recent Files List" operator. This PR removes that clearing.
Pull Request: https://projects.blender.org/blender/blender/pulls/127882
The Scale node in the Scale To Render size mode is not precise in case
of the use of render size percentage. This is due to floating point
imprecisions and we mitigate it by rounding instead of flooring after
multiplying by the percentage.
The Kuwahara node produces NaNs if the pixels have a very high local
standard deviation and sharpness is also high. This is because the
weighted sum of the Kuwahara sectors can have a zero total weight, which
causes zero division. To fix this, we return the original color if the
total weight is zero.
Pull Request: https://projects.blender.org/blender/blender/pulls/128378
Adds `BKE_grease_pencil_copy_layer_parameters` and
`BKE_grease_pencil_copy_layer_group_parameters` to copy
the parameters of layers and layer groups without copying
the data.
We'd first set the brush, then change tools, which would again set the
brush to what it was before (switching tools tries to remember its last
used brush). Instead, switch the brush after switching the tool.
Also added a brush API check to test if the brush is valid for the
current mode, so that we don't end up switching tools in that case. This
matches previous behavior where this would be checked as part of setting
the brush already, causing the function to early exit before the tool is
changed.
The Alpha Over node has an unexpected output size in GPU mode. If the
Factor and first Image inputs were connected to the same output, the
size of the output will assume the size of the second Image input, even
though the first Image input has a higher domain priority.
That's because the Alpha Over node is compiled into a Shader Operation
which has a single operation input for all inputs connected to the same
output, but only the domain priority of the first input was considered,
so in the case of the Alpha Over node, the domain priority of the Factor
input was assumed, ignoring the priority of the first Image output.
To fix this, we consider the priority of all inputs connected to the
same output, and assume the highest priority of all.
Pull Request: https://projects.blender.org/blender/blender/pulls/128366
The problem with the Integer Math node is that it is less flexible in common
cases because the other input has to be an integer too. There is no simple way
to switch the node to be a Float Math node (yet), so better insert that
directly. Using the Integer Math node is a more explicit choice now.
Searching for e.g. `iadd` prioritizes the Integer Math node thanks to prefix
search.
Pull Request: https://projects.blender.org/blender/blender/pulls/128370
This solves an issue when both linear gizmos happen to be at the same position.
In this case the gizmos became fairly unusable because they overlapped a lot.
They can still overlap of course, but it's more likely that they start at the
same position than that they end at the same position.
Note, when using a transform gizmo, the collision between the scale and
translate gizmo is resolved already. The issue only happens when two independent
Linear Gizmo nodes are used.
Pull Request: https://projects.blender.org/blender/blender/pulls/128371
Calling `action.fcurves.clear()` would clear the F-Curves, but didn't
update the F-Curve groups. This meant that the groups data still had their
original length & offsets into the F-Curves array, causing subsequent
F-Curve creation to crash Blender.
The unit test for this also covers the previous commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/128375
Fix an issue where Python's `rna_struct.keyframe_insert(path, index=-1)`
would not create any keys. This was caused by the new layered animation
code not taking -1 as an 'all array elements' wild-card.
The accompanying unit test will follow in another commit, as its success
depends on another bugfix as well.
This was broken by 8027720e51 because
we forget to update the label in the declaration.
This is now reverted for the Mesh Line node, because there is no way to
change the label in the declaration yet. A new patch can be created that properly
updates the Mesh Line node to use the declaration.
It is possible to have IK solver without actual bones. There was a relation
created for this case, but it was originating from a wrong operation: it
was possible to run into situation when init is not yet done, but cleanup
is already run.
Fix the relation which ensures the order to go from IK initialization and
not the pose initialization. This should ensure proper cleanup order.
There is a relation from pose initialization to IK initialization so this
change should not cause any missing relations.
This should fix the intermittent failure of blendfile_versioning_1_over_8.
Pull Request: https://projects.blender.org/blender/blender/pulls/128267
* Handle the case where `drawing_array_num` is 0.
* Reset the pointer of the active node (because it is no longer valid)
* Cleanup copy-paste error in docstring
Blender crashes when viewing invalid images in the compositor. That's
because cached images will not be null, but will be unallocated, so to
fix this, we check allocation status as well as nullptr in the image
node.
Getting the active tool from context doesn't work exactly when executed
from the properties editor, which shows the active tool settings of the
3D view. Make the brush tool code fallback to the active tool from the
3D view, so it can be called from the properties.
Users of the layered Actions API should never mutate the data via these
spans, and so the functions should always return just a `Span<>`.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/128264
Instead of `Geometry`, the fallback name is now `(Geometry)`. The goal is to
make it more obvious that this is not the actual name, but just a fallback. With
some luck it also motivates people to use better custom names.
The same thing is done for grease pencil layer names.
Pull Request: https://projects.blender.org/blender/blender/pulls/128207