This was caused by 87c011f8bb. The drawing code for the input nodes was moved
into a new `custom_draw_fn` callback on the socket declaration. This was not
taken into account when drawing the sidebar yet, which is an oversight and was
not an intentional change.
This fix applies to all the nodes that use the new custom draw function.
Pull Request: https://projects.blender.org/blender/blender/pulls/141872
The node warnings were only referenced by the tooltip function. Since they are
recreated on every evaluation, this resulted in a use-after-free. The fix is to
just copy the node warnings into the callback.
Of course this extra copy does have some performance implications, but I don't
think those are significant currently.
Pull Request: https://projects.blender.org/blender/blender/pulls/141875
Different operations may need to lock different part of the interface,
e.g. for rendering, the image editor may still need refreshing while the
interface is locked, but when baking data into a scene, the image editor
needs to be locked because it is not thread safe to get data from a
partially evaluated depsgraph.
This is a better fix on top of 7c8b8b2457
that addresses the root cause with more flexibility for future
operations that requires different interface locking strategy as
well.
Pull Request: https://projects.blender.org/blender/blender/pulls/141866
When the Join as Shapes operator created new shape keys, trigger a rebuild
of depsgraph relations. Otherwise mesh evaluation may see original keys
instead of evaluated ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/141892
Caused by 3d6ea7c075
Before that commit, it was possible to retrieve shape key data from
other objects with a different number of edges or faces. One crucial
case where that is important is when the other mesh is a triangulated
with otherwise the same vertex count.
In general it's better to be flexible and allow other changes besides
the vertex count, especially since that's such a simple check that users
can easily understand.
Pull Request: https://projects.blender.org/blender/blender/pulls/141794
Replace a `StringRef` with `std::string`, so that a copy is made of the
grid item identifier.
This identifier is used on redraw, to correlate the newly-drawn items
with items from the previous redraw. Using a `StringRef` here was
problematic when there's local assets, as those can be freed & re-built
(which in the case of the report happens on save/undo). Because of this,
the reference got corrupted, and the map lookup would fail. The "old
items" map now has a copy of the identifier, ensuring it is independent
of the data it represents.
Co-authored by Julian Eisel.
Pull Request: https://projects.blender.org/blender/blender/pulls/141888
Regression caused by 9e4c26574a.
Add strip stack as a key to the final cache.
Use the pointer to the list of sequences, as it is the easiest one to
obtain in all places where it is needed. This is slightly different
from the code prior to the 9e4c26574a where strips.last() was used,
but it allows to use the same logic in the prefetch job.
Pull Request: https://projects.blender.org/blender/blender/pulls/141778
Blender will crash if a file with an Alpha Over node was saved in 4.4,
then in 4.5 alpha, then back to 4.4. This is because the node was
missing forward compatibility code that allocates storage that was
necessary for the file to load correctly on older versions.
This was essentially missed in b62ef2cdd6 and 976efdcac9.
Pull Request: https://projects.blender.org/blender/blender/pulls/141873
Meshes could still be present or missing when toggling overlays.
Toggling overlays alone does not trigger object syncing (which is needed
here since the visibility of active object might change).
So to resolve, trigger `rna_SpaceView3D_retopology_update` when toggling
overlays with enabled Retopology
Ref. 6fee44760a
Pull Request: https://projects.blender.org/blender/blender/pulls/141731
Regression in 3.6 caused the orthographic camera gizmo to enter a
feedback loop where the gizmo range was changed while being interacted
with.
Resolve by preventing the range being updated during modal interaction.
Fix the ID user count when changing `posebone.custom_shape`.
The code uses `reinterpret_cast<ID *>(pchan->custom)` instead of
`&pchan->custom->id`, as the former is `nullptr`-safe.
Pull Request: https://projects.blender.org/blender/blender/pulls/141726
Refactor from e5a921ad9b did not account for the fact that some
`poll_instance` functions may require valid ID pointers in the checked
node. This is the case e.g. of the node group node, as it also checks
all of the nodes inside the referenced nodegroup.
This commit also fixes a logical mistake in the polling check, that
would systematically prevent pasting of nodes with no `poll_instance`
callback.
Pull Request: https://projects.blender.org/blender/blender/pulls/141729
Make display channel part of the key for the final cache.
The prefetch uses display channel of 0, which is the default. It might
need to be adjusted, but it is unclear whether it was behaving different
prior to the 9e4c26574a.
Pull Request: https://projects.blender.org/blender/blender/pulls/141670
Alternative solution to #141392 / #141564.
As a recap, the DST global lock (which prevented running drawing code
from multiple threads concurrently) was removed for 4.5 (#134690).
One unforeseen issue is that Images (and their GPUTextures) are shared
across dependency graphs (and therefore multiple threads), meaning we
are running into data race issues with them.
@fclem did #141392 and I continued it #141564. However, this is only a
partial solution, parts of the GPUTexture API and the whole BKE_image
API are still unsafe.
Trying to solve all the possible underlying issues seems unrealistic for
4.5 given the time frame and that the extension of the code affected by
this issue is quite large.
So this PR just brings the 4.4 locking behavior instead, which, while
risky on its own, seems much safer to me than the alternative.
This effectively undoes the improvements from #134690 by disabling
concurrent rendering, but instead of reverting all the code, it just
ensures we hold the lock in the same places we did in 4.4.
This means there's some redundant code that is not technically needed
anymore, like the `submission_mutex`, but it's probably best to make as
few modifications as possible, given how close we are to release and
that this is only intended as a temporary measure.
Pull Request: https://projects.blender.org/blender/blender/pulls/141618
Implicit conversion for single values always return zero in GPU device.
That's because the conversion data was only stored on the CPU and not
uploaded to the GPU, so we ensure it gets uploaded to GPU.
Pull Request: https://projects.blender.org/blender/blender/pulls/141658
Don't attempt to fill curve caps when the direction vector is invalid.
This prevents the crash in #141612 however the root cause of that
report isn't directly related to curve filling.
The check to prevent overly complex tessellation checked the objects
scale directly instead of the final evaluated scale.
Also corrects the scale check which wasn't accounting for negative axes.
The mesh importer was only checking for animated positions, velocities,
and primvars when determining if a cache modifier needed to be used.
Extend this to crease values (and normals) too.
The added test ensures a base level of coverage here.
Related to: #141633
Pull Request: https://projects.blender.org/blender/blender/pulls/141643
This commit fixes a bug where the timeline area height was clamped to
its minimum value when restoring an area layout saved on a non-HiDPI
screen on a HiDPI screen. In particular, this caused the default Blender
startup file timeline area to be wrongly clamped dwon on macOS when
using a HiDPI/Retina screen.
This was due to the `screen_geom_vertices_scale_pass` function using raw
`area->winy` value in the `facy > 1` case, which ensures the timeline
does not get expanded when resizing the window if its already at its
minimum height. When restoring the area layout, these `winy` values
were not yet refreshed, and still used the DPI scale of the screen
the layout was saved on. Which in case of macOS HiDPI screens caused
them to be two times smaller then the screen / other size values used
in the function.
This was fixed by using the `screen_geom_area_height()` instead, which
computes the area height from its screen geometry coordinates, and was
previously used in this function before being replaced by `winy`. The
comparaison now also uses a fixed value instead of `facy` which was
also subject to DPI differencies, see PR thread for more details
Pull Request: https://projects.blender.org/blender/blender/pulls/141154
Line art bakes strokes in a separate thread, which will also update
depsgraph, and if an image editor is present, it will try to iterate all
the objects in the view layer and this is unsafe. Now line art will set
region drawing lock to prevent image editor from drawing while baking.
Pull Request: https://projects.blender.org/blender/blender/pulls/141551
Fix an issue with Copy to Selected on bones, where an RNA pointer was
given an owner of the wrong type.
A pointer was constructed to a `Bone` (which is owned by the
Armature), but the owner was taken from the corresponding `PoseBone`
(which is owned by the Object), causing Armature "property update"
callbacks to be called without an actual Armature. This caused the
wrong data to be tagged for re-evaluation, which caused the issue.
Also f04bc75f8c affected the Copy to Selected on edit bones.
Co-authored by Philipp Oeser
Pull Request: https://projects.blender.org/blender/blender/pulls/141394
The feature to display multiple objects in the UV and Image Editor was
added in 24d08e0bae.
This commit did not account the multi-edit mode feature, where there may
be more than one object currently being edited, causing some UVs to
display with a faded opacity.
To fix this, introduce a new `eObjectInfoFlag` flag to indicate this
state, populate it when syncing the object, and use the flag inside the
relevant shaders.
Pull Request: https://projects.blender.org/blender/blender/pulls/141254
When handles are selected but not the control point this will convert the types `auto` to `align` and `vector` to `free`
This adds `tag_topology_changed` to make sure the handle types are updated.
This also fixes a problem where `free` handle would not be transformed with the control point.
Implement following Curve objects #128638
Pull Request: https://projects.blender.org/blender/blender/pulls/141438
Material selection didn't support empty geometries. Geometry list can
have nullptrs, when meshes contain more than 16 materials, but some
materials slots are not actually used in the mesh.
Material selection used to still looped over all the materials and
tried to draw geometry that aren't there.
Regression from !139781
Pull Request: https://projects.blender.org/blender/blender/pulls/141608
When beveling a vertex with only 2 connected edges, the resulting
geometry was not selected.
Resolve by not only selecting the faces created by the bevel operation,
but also selecting the vertices created.
Note: apply the same change as before,
the LFS data has been manually pushed.
Ref !139691
Windows/Intel GPU crashes when descriptor buffer cannot be allocated
anymore. This PR enables a workaround by not using descriptor buffers.
In future we should investigate how to improve the GC of descriptor
buffers and review the limits.
Pull Request: https://projects.blender.org/blender/blender/pulls/141600
Switching back and forth between viewers with shortcuts doesn't trigger
the compositor to update as expected when inside a node group.
See PR description for an example file.
The issue was caused by a missing tree update.
Pull Request: https://projects.blender.org/blender/blender/pulls/141606
When beveling a vertex with only 2 connected edges, the resulting
geometry was not selected.
Resolve by not only selecting the faces created by the bevel operation,
but also selecting the vertices created.
Ref !139691
Correct problem where face split inadvertently triggered the
un-triangulate detection logic in places due to freshly added diagonals.
Defer face split until after tagging is complete so the new edges don't
interfere with edge counting.
Ref !141511
When the layer tree in the evaluated state of the Grease Pencil object changed,
the code would fail to get the crazyspace deformation.
Currently we rely on a 1 to 1 index mapping of the original and evaluated
layers. For obvious reasons, this is very weak and can easily break.
The new implementation works as follows:
* Caller that wants to get the crazyspace deformation passes the evaluated and original
object + the original drawing to get the deformation of.
* Fallback deformation are the original positions.
* If there are drawing edit hints in the evaluated geoemtry set, then
* find the edit hint that corresponds to the original drawing
* use the positions in the edit hint.
To create the drawing edit hints, we need to know what evaluated layer corresponds
to which original layer. Currently, this simply stores the original layer index on the
evaluated layer runtime data.
The solution is not ideal and there are some possible improvements like:
* Find a way to solve the more general case, e.g. when there are multiple original
IDs involved.
* Propagate the "mapping" to original layers even when the type of geometry is
changed, like going to curve instances and back.
Pull Request: https://projects.blender.org/blender/blender/pulls/139285
This is related to #140381, where the symptom of the bug was a crash
caused by an undefined behavior. In that case, setting a valid active
viewer key was the proper fix. However,
`find_active_context_recursive()` could return `nullptr` in theory so
the same problem might occur in the future.
The commit resolves the undefined behavior by avoiding the
dereferencing of a null pointer.
Pull Request: https://projects.blender.org/blender/blender/pulls/141270