Missed in 0161a19669
Unlike many other brushes, the Layer brush uses the original coordinates
of a given vertex only for the distance test when calculating the factor
and does not use it for other components such as textures.
Note that this commit looks larger than the change would imply, as it
required undoing a recent refactor that is no longer applicable with the
distance changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/128723
We no longer keep the active_vert value in a valid state when the cursor
is not over the mesh. The helper method to access this position can
thus result in incorrect behavior when storing and retrieving this
value.
In this case, we simply avoid setting the `UnifiedPaintSettings` values
related to the last stroke, so that when it is used in
`view3d_navigate.cc` it falls back to the object origin.
Pull Request: https://projects.blender.org/blender/blender/pulls/128716
Fixes a crash caused by a null pointer dereference when the Mesh Filter
tool with Erase Displacement option is used on a mesh that has no
Multiresolution modifier.
Pull Request: https://projects.blender.org/blender/blender/pulls/128632
This fixes#127629. It's still a bit slower than it used to be when there are
lots of instances, but that fixes the main bottleneck that was introduced in
#116582. The issue was that we iterated over all attributes of all instances,
but it should only be necessary to iterate over the instances of each unique
geometry only once.
There is still quite some optimization potential in the Realize Instances code
for the case when realizing lots of instances. Especially the code to gather all
geometries that should be realized can still be made more efficient by reducing
redundant work and using multi-threading.
Pull Request: https://projects.blender.org/blender/blender/pulls/128699
Before version 4.1, the vertex destination during edge sliding for two
independent edges was always the midpoint of the vertices closest to
those edges.
In version 4.1, this behavior was improved to calculate the destination
based on the intersection of the edges. However, when the faces were
coplanar, the behavior would revert to the previous midpoint
calculation instead of using the intersection.
This fix ensures that the vertex destination consistently aligns with
the intersection point, even when the faces are coplanar.
In non-manifold geometry, the original loop could fail to identify the
correct slide direction because it checked for loop equality
(`l_other != l_edge`), which might never be met.
The condition has been revised to check for face equality
(`l_other->f != l_edge->f`), ensuring the loop terminates correctly and
preventing infinite iterations in problematic geometry cases.
Blender crashes when using the GPU compositor sometimes. This is because
compositor render data was accessed before it was updated in the
realtime compositor when detecting compositing device. So fix that by
first updating compositor data before calling any context methods.
When inserting a key on a slotted Action, apply NLA remapping on both
the key's time and value.
This pushes the fork in the code (between legacy & new Actions) a bit
further down the call stack.
Ref: #120406
Pull Request: https://projects.blender.org/blender/blender/pulls/128700
During stage load we first look for Prototype prims which are used for
instancing. However, if the instancer itself at the root of that
Prototype hierarchy would later be excluded because of either purpose or
visibility checks, the Prototypes would still be processed. These would
correctly be imported but would end up orphaned because nothing would
later add them to the view layer. Code expecting these objects to be
found within the scene would then fail.
In Animal Logic ALab this situation played out where there was a
`/root/instancer` prim with purpose "render" and we proceeded to load
the prims under the `/root/instancer/Prototypes/...` hierarchy. Since we
were attempting to load just the "proxy" purpose, the `/root/instancer`
was later excluded and the orphaning of those prototypes happened.
The change here moves `collect_point_instancer_proto_paths` to a method
of `USDStageReader` so it can now access `include_by_purpose` and
`include_by_visibility`. And these are now used to prevent unnecessary
Prototype loading.
Pull Request: https://projects.blender.org/blender/blender/pulls/128564
Blender crashes when opening a file that has an interactive compositor
active, while also having a script that invokes the compositor upon file
load.
This is caused by the same system GPU context being active in two
threads at the same time, which happens when the GPU context for the
compositor is created in the main thread, it is made current during
creation, but it is not reset to the main GPU context of the drawable
because it is null. So when the GPU compositor actually executes, it
makes the GPU context current again but in its own thread, causing a
BadAccess error in X11 and potentially other window systems.
The reason why the drawable is nullptr is because it is reset in the
existing window manager when opening a new file while Blender is open,
but it is never initialized for the new window manager. The drawable
info should be moved from the old window manager to the new window
manager in wm_file_read_setup_wm_use_new, but it is preemptively reset
by the wm_window_clear_drawable call before it it is moved. This is done
in wm_file_read_setup_wm_substitute_old_window.
So to fix this, we move wm_window_clear_drawable after the code block
where wm_file_read_setup_wm_substitute_old_window gets called.
Follow-up to #128061, which addressed the export side of this.
This updates the Collada import code to import properly to slotted
actions.
Note that importing the animation of non-transform properties (e.g.
camera fov, material colors, lamp intensity, etc) does not work,
but that isn't caused by this PR. That was already not working at
least as far back as Blender 3.6.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/128529
Reorder the Action and Slot assignment function declarations, so that
they are grouped a bit more sensibly.
Of the touched functions, I also replaced `ATTR_WARN_UNUSED_RESULT` with
`[[nodiscard]]`.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/128695
This wasn't working because the code that stores the backup up the current pose
looped over the pose asset's fcurve listbase to determine which bones needed to
be backed up. When the pose asset was stored as a slotted action, that listbase
was always empty, so nothing was backed up. This resulted in exploding poses as
the pose was repeatedly applied on top of itself, and in debug builds would
trigger asserts in code that was sanity-checking quaternion values.
This PR updates that code to loop over the fcurves of the first slot when the
pose asset is stored as a slotted action, which in turn makes pose blending
work as expected with slotted actions.
Pull Request: https://projects.blender.org/blender/blender/pulls/128686
Between 0bfd5e3536
and b1cbd9c889
the main branch is incorrectly processing the file
`draw_debug_info.hh` as GLSL and does some string
preprocessing on it. But the output filename matches
the name of the header source file used for compiling
the gpu module. This file not having been updated
since a long time doesn't get copied from the source
folder when switching to other branch and make compilation
fail.
In order to avoid breaking the buildbot longer, we
rename the incriminating file to force recreate it
when building the release branch.
When operator property is tweaked in preferences > keymap > "any operator",
preferences are not tagged dirty, which prevents writing the userpref
file at `WM_exit_ex` when auto-save is enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/128516
This catches the exception and shows the error message to the user.
We don't have much control over the error message here currently. Better just
report it for now. In the future we could try to detect what error it is exactly
and produce a more user friendly error.
This is a follow-up to #128363, and fixes up the remaining areas of
the sequencer's code that didn't yet account for slotted actions:
1. Moving strips failed to move their animation with them.
2. Duplicating strips failed to duplicate their animation with them.
3. Deleting strips didn't delete their animation channels with them.
This also takes the opportunity to add depsgraph tagging and
notifiers that were already missing in the pre-slotted-actions
code, for the strip delete and strip paste operators. The absence
of these was making the UI not update and was also causing stale
animation data to get evaluated.
Pull Request: https://projects.blender.org/blender/blender/pulls/128440