The API did not initialize the `curve_type` for the newly created strokes resulting in unwanted behavior.
Set the curve type to the expected default: `POLY`.
Adds an additional precheck to identify if the app cache dir is correct.
Reduces placing cache files all over the place when the app dir isn't
correct.
Adds a SPIR-V cache that skips frontend compilation for shaders
that are already compiled in a previous run of Blender.
Initially this was postponed to 4.4 but it was observed that
the vulkan backend didn't perform well on Windows in debug
builds. The reason is that the compiler would also be a debug
build which makes compiling a shader really slow. Starting
Blender on a debug build could take minutes.
So the decision was made to give this task a higher priority so
the vulkan backend would become more usable to developers
as well.
The cache is stored in the application cache dir. The SPIR-V
binaries can be used by different Blender versions so there
is no version specific cache folder.
**Sidecar**: SPIR-V files are a stream of bytes. There is no
header information that allow us to validate the stream. To
add basic validations we could add our custom header or
a sidecar. It was chosen to use a sidecar as having the SPIR-V
files unmodified allows us to load them directly in
debug tools for analyzing.
**Retention**: Shaders that are not used are automatically
removed with a retention period of 30 days.
**Shader builder**: Shader builder cannot use the SPIR-V
cache as it uses stubs that returns invalid cache directories.
This would load/save the cache to the location where you
started the build.
Pull Request: https://projects.blender.org/blender/blender/pulls/128741
This was located in BKE_appdir which is higher level
(used for accessing Blender's paths), where as the home directory
may be accessed from lower level path code.
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.