Commit Graph

120055 Commits

Author SHA1 Message Date
Falk David
821cfcbe4a Fix: Build warnings missing include
Caused by a57206dd59.
Missed to remove the line that included the legacy
folder.
2024-10-08 12:43:58 +02:00
Falk David
92b4c853db Fix: Python: Incorrect default curve_type when calling drawing.add_strokes()
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`.
2024-10-08 12:37:10 +02:00
Bastien Montagne
39d4d06f4f Refactor: Move PointerRNA and related users to C++-style new/free. 2024-10-08 12:14:03 +02:00
Falk David
35c2461130 Fix: Build warnings missing include
Caused by a57206dd59.
Missed to remove the line that included the legacy
folder.
2024-10-08 11:37:58 +02:00
Jeroen Bakker
70590d1bd9 Merge branch 'blender-v4.3-release' 2024-10-08 11:33:14 +02:00
Jeroen Bakker
27932162d8 Fix: Cache files location
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.
2024-10-08 11:32:41 +02:00
Jeroen Bakker
c15cda2bf1 Merge branch 'blender-v4.3-release' 2024-10-08 10:55:38 +02:00
Jeroen Bakker
3cd579208b Vulkan: SPIR-V Caching
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
2024-10-08 10:55:10 +02:00
Philipp Oeser
6bd8871409 Merge branch 'blender-v4.3-release' 2024-10-08 08:20:23 +02:00
Philipp Oeser
3dd20a64f0 Fix #128633: Image gizmo missing update for the Properties Editor
Send appropriate notifier so the Properties Editor listener
(buttons_area_listener) will catch this and redraw.

Pull Request: https://projects.blender.org/blender/blender/pulls/128688
2024-10-08 08:19:45 +02:00
YimingWu
42f171c216 Null check in screen_ctx_grease_pencil_data
There could be no active object in 2d animation workspace, this prevents crashing.
2024-10-08 14:09:14 +08:00
Campbell Barton
82ab7ceba6 BLI_fileops: move home directory access to BLI_fileops
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.
2024-10-08 12:23:40 +11:00
Campbell Barton
ad88aedbac Docs: note that recent files shouldn't remove files that don't load 2024-10-08 11:34:15 +11:00
Campbell Barton
91aa21e086 Docs: simplify the description of the select by pole count operator 2024-10-08 10:52:15 +11:00
Campbell Barton
c0e9184e5b Cleanup: remove white-space to satisfy license checker 2024-10-08 10:06:22 +11:00
Campbell Barton
2e881eacd1 Cleanup: spelling in comments 2024-10-08 09:54:29 +11:00
Campbell Barton
3525b83c6b Cleanup: use specific exception types where appropriate 2024-10-08 09:41:53 +11:00
Campbell Barton
1a1e75c253 Cleanup: replace implicit BaseException with Exception
Exception is more appropriate as a general exception in these cases.
2024-10-08 09:41:51 +11:00
Jacques Lucke
7a4329320f Merge branch 'blender-v4.3-release' 2024-10-08 00:28:06 +02:00
Iliya Katueshenock
6487fc96dd Fix #126024: Separate Geometry nodes does not propagate grease pencil materials
Pull Request: https://projects.blender.org/blender/blender/pulls/128664
2024-10-08 00:27:34 +02:00
Jacques Lucke
226f1b4f01 Merge branch 'blender-v4.3-release' 2024-10-08 00:22:00 +02:00
Jacques Lucke
7777fca066 Fix #128178: missing update after attribute conversion
The same is done in `geometry_attribute_convert_exec`.
2024-10-08 00:21:03 +02:00
Campbell Barton
8c3ef77a35 Cleanup: spelling in comments 2024-10-08 09:03:49 +11:00
Sean Kim
d38dbcf90f Merge branch 'blender-v4.3-release' 2024-10-07 14:05:09 -07:00
Sean Kim
03d5530788 Fix #128675: Layer brush creates bumps in mesh
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
2024-10-07 23:04:04 +02:00
Sean Kim
ae848580d6 Merge branch 'blender-v4.3-release' 2024-10-07 13:43:59 -07:00
Sean Kim
197253c75c Fix #128508: Orbit around selected can shift view to negative infinity
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
2024-10-07 22:42:43 +02:00
Sean Kim
0fca174e80 Merge branch 'blender-v4.3-release' 2024-10-07 13:41:46 -07:00
Sean Kim
061ea2c530 Fix #128635: Snake Hook brush cannot use texture
Missed in bf05ac13c8

Pull Request: https://projects.blender.org/blender/blender/pulls/128720
2024-10-07 22:41:07 +02:00
Sean Kim
66697cb81e Merge branch 'blender-v4.3-release' 2024-10-07 13:40:00 -07:00
notrudyyy
bacbed14d0 Fix #128595: Mesh Filter Erase Displacement crashes without multires
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
2024-10-07 22:39:02 +02:00
Sean Kim
207150affe Merge branch 'blender-v4.3-release' 2024-10-07 13:36:30 -07:00
Sean Kim
983ef262d8 Fix #128618: Crash when using cloth brush and automasking
Mistake in f4f732be95

Pull Request: https://projects.blender.org/blender/blender/pulls/128713
2024-10-07 22:34:23 +02:00
Jacques Lucke
f0b804a371 Merge branch 'blender-v4.3-release' 2024-10-07 22:19:36 +02:00
Jacques Lucke
99d73565d6 Geometry Nodes: optimize gathering attributes to fix regression
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
2024-10-07 22:18:44 +02:00
Jesse Yurkovich
af7f6fb82f Merge branch 'blender-v4.3-release' 2024-10-07 12:30:45 -07:00
Pablo Delgado Krämer
384f64f215 Fix Hydra crash with UsdPreviewSurface render delegates
When a render delegate does not use MaterialX (by setting
`bl_use_materialx = False` in engine.py), a crash can occur because the
worker_status is null.

Pull Request: https://projects.blender.org/blender/blender/pulls/128607
2024-10-07 21:29:48 +02:00
Germano Cavalcante
52136d3afa Merge branch 'blender-v4.3-release' 2024-10-07 14:34:22 -03:00
Germano Cavalcante
49ab0bb844 Fix: Edge Slide: Vertex destination not matching edges intersection
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.
2024-10-07 14:32:33 -03:00
Germano Cavalcante
580e0af309 Fix #128702: Edge Slide can cause Blender to freeze
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.
2024-10-07 14:04:52 -03:00
Falk David
9d09362c0c Fix #128698: GPv3: Layer adjustments are applied to original geometry
Mistake in b4881f6b0a.
The function `grease_pencil_do_layer_adjustments` needs
to be called *after* creating the geometry set for
evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/128706
2024-10-07 19:02:12 +02:00
Omar Emara
1aa662263b Merge branch 'blender-v4.3-release' 2024-10-07 19:53:31 +03:00
Omar Emara
027d3acb4d Fix #128414: Compositor crashes using GPU compositor
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.
2024-10-07 19:48:32 +03:00
Lukas Tönne
d7e3f55eea Merge branch 'blender-v4.3-release' 2024-10-07 18:22:17 +02:00
Lukas Tönne
a57206dd59 GPv3: Remove unused legacy editor functions for GPv2
Removes all unused functions in ED_gpencil_legacy.hh

Pull Request: https://projects.blender.org/blender/blender/pulls/128597
2024-10-07 18:21:28 +02:00
Jesse Yurkovich
daddd56be1 Merge branch 'blender-v4.3-release' 2024-10-07 09:14:09 -07:00
Sybren A. Stüvel
0a74768a98 Anim: when inserting a key on a slotted Action, correctly remap via NLA
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
2024-10-07 18:09:42 +02:00
Jesse Yurkovich
1676c06386 Fix #128504: check instancer purpose and visibility before processing
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
2024-10-07 18:08:22 +02:00
Omar Emara
0141c84b0d Merge branch 'blender-v4.3-release' 2024-10-07 18:49:01 +03:00
Omar Emara
0a70360eb6 Fix: Blender crashes opening a file with compositor
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.
2024-10-07 18:34:54 +03:00