Commit Graph

141952 Commits

Author SHA1 Message Date
Christoph Lendenfeld
41a3e6c3bd Fix #125451: Duplicating bone doesn't copy pose bone colors
When duplicating a bone (has to be done in edit mode)
the pose bone colors were not copied.
This adds the code to do just that

This also fixes it for symmetrising because that uses the
same code path

Pull Request: https://projects.blender.org/blender/blender/pulls/129007
2024-10-16 09:26:48 +02:00
Campbell Barton
ccb92947c5 Fix #129067: Transforming an edit-mesh crashes with cage editing
Regression in [0] although prior to this the `deformed_only` was not
being set, caused by a separate regression.

[0]: 80fa49f24ae768c5869065363e116b51175fb2df
2024-10-16 16:57:06 +11:00
Sean Kim
b8e5c66947 Fix #129069: Drag Dot and Anchored paint brush modes don't clear mesh
Introduced in d282b1735e

The two stroke types need to have the mix_colors StrokeCache variable
reset in between daubs to prevent extra data from accumulating when
applying colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/129084
2024-10-16 07:04:08 +02:00
Campbell Barton
346bea93cc Cleanup: wrap long lines 2024-10-16 15:00:11 +11:00
Campbell Barton
c3b067dc80 Cleanup: single/double quote use in scripts 2024-10-16 14:45:08 +11:00
Campbell Barton
7ae7592899 Fix #128346: Search results fail to display in the outliner
Regression in [0] caused the outliner not to draw at the clamped scroll
position. This meant searching in the outliner could show no results
even when results were found. It also meant deleting objects could show
nothing until the user manually forced the outliner to redraw.

Workaround the problem by detecting when outliner drawing changes the
scroll position and draw again. While inelegant this doesn't happen
often in practice.

Fixing without a second draw likely involves resolving the order of
initialization problem by separating bounds calculating from drawing.

[0]: a63ac425d0
2024-10-16 14:05:23 +11:00
Sean Kim
f5e660f5f0 Fix #129076: Missing headers in Weight Paint
Introduced in 79ae0f86da

Pull Request: https://projects.blender.org/blender/blender/pulls/129082
2024-10-16 01:10:33 +02:00
Sybren A. Stüvel
399c2148c3 Cleanup: run make format
No functional changes.
2024-10-15 15:12:42 -07:00
Jesse Yurkovich
81f439ff37 Fix #128916: Tag Light ID when applying scale
When applying scale on a light in the viewport, ensure we tag the light
itself for updating. Otherwise, the viewport get confused over which
size to use.

Pull Request: https://projects.blender.org/blender/blender/pulls/129030
2024-10-15 20:24:32 +02:00
Sebastian Parborg
417f9f29cf Linux: Bump autopep8 version 2024-10-15 19:21:21 +02:00
Sebastian Parborg
1458ba1d6c Bump Linux libs 2024-10-15 18:26:31 +02:00
YimingWu
1e2e90e2d4 Fix #129051: GPv3: Write default u_scale in draw tool
The `u_scale` should be given a default value of `1.0f` so that newly drawn
strokes with the drawing already having `u_scale` attributes will have
correct texture mapping size instead of a default of `0.0f`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129060
2024-10-15 16:39:17 +02:00
Thomas Lachmann
5f84f934a8 Fix #127087: GPv3: Initialize/copy attributes when adding/duplicating layers
- set default values for attributes on new GP layer
- copy attributes when duplicating GP layer

Pull Request: https://projects.blender.org/blender/blender/pulls/128344
2024-10-15 15:08:09 +02:00
sean-murray
5be60642ad Fix: GPv3: Crash when using build modifier with cyclic curves
The build modifier crashes when getting lengths of cyclic curves because `evaluated_points_by_curve`
was previously always called with `cyclic` parameter set to `false`.
The `cyclic` parameter necessary for `curves::segments_num` to return correct number of segments.

Pull Request: https://projects.blender.org/blender/blender/pulls/128955
2024-10-15 14:17:05 +02:00
Falk David
715a37b662 Fix #129049: Solid mode doesn't render strokes correctly
Caused by 364d62e59b.

In draw mode, we want to make sure to show vertex colors by default
because users can draw with them. Otherwise this can lead to unexpected
behavior in solid shading mode when vertex colors used to not be
rendered in draw mode.

The previous fix tried to do this by enforcing the `V3D_SHADING_VERTEX_COLOR`
mode in draw mode. But this has the side effect that the material
stroke and fill color are overriden with pure white.

To fix the issue correctly, simply ensure that `vert_col_opacity` in
`grease_pencil_layer_cache_add` is set to 1.0f. This means that
vertex colors and material colors are shown just like in the render.

Also resolves #128680.

Pull Request: https://projects.blender.org/blender/blender/pulls/129054
2024-10-15 13:47:24 +02:00
Jeroen Bakker
6f6efb6ec0 Vulkan: Disable Intel 10th gen and lower on Windows
Intel Windows drivers for 10th gen and lower has some strange behavior
when using dynamic rendering. It requires pipeline conditions to be met,
when beginning a new rendering scope. This is strange as specs + VVL
notes that these conditions should be met during vkCmdDraw* commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/129055
2024-10-15 13:44:05 +02:00
Jeroen Bakker
cdef54a5ce Vulkan: Workaround for unused attachment extension
This change makes unused attachments extension optional.
This extension is fairly new and not all drivers have support for it.

The workaround will create additional pipelines when attachments are
not set.

Pull Request: https://projects.blender.org/blender/blender/pulls/129046
2024-10-15 13:43:21 +02:00
Thomas Dinges
888473b064 Readme: Update various links. 2024-10-15 13:16:00 +02:00
Falk David
016008e097 Formatting 2024-10-15 13:04:50 +02:00
Falk David
251250a3fb Fix #128991: GPv3: Python: Writing to invalid properties doesn't raise exception
When writing to a property that doesn't exist e.g. `frame.drawing.strokes.test = 42`
no exception would be raised and it would silently fail.

The fix defines the `__slots__` on the classes explicitly which then raises an exception
if the user tries to write something that wasn't previously defined.

Pull Request: https://projects.blender.org/blender/blender/pulls/129047
2024-10-15 12:23:02 +02:00
Falk David
39675bb0fb Fix: GPv3: Python: Setting attribute value always creates new attribute
When e.g. executing `drawing.strokes[0].softness = 3`, the API would
always create a new attribute `softness` even if that attribute existed
already.

The issue was that the code was using the `.get(value, fallback)` syntax
but the `fallback` expression is always evaluated by python.

The fix removes the use of the `fallback` and uses a simple `if/else` to
check if the attribute doesn't exist yet and only then create it.

Pull Request: https://projects.blender.org/blender/blender/pulls/129044
2024-10-15 12:22:32 +02:00
Mark Stead
dfc58d282b Fix #69731: Cycles: Vector Pass ignores animated FOV
This PR fixes the motion vector values when using animation of the (perspective)
camera focal length (and therefore changing the fov).

Pull Request: https://projects.blender.org/blender/blender/pulls/127442
2024-10-15 11:42:11 +02:00
Nika Kutsniashvili
f909bf2b13 Fix: GPv3: Add missing keymaps
Adds missing keymaps in Grease Pencil modes. Two menus are also added which are needed to be called by keymaps to match GPv2.

**Paint Mode**
| Keymap | Operator |
| -------- | -------- |
| Shift I     | Insert Blank Keyframe |
| Alt I | Delete Animation (menu) |
| Shift Delete | Delete Active Keyframes (all layers) |
| Shift Ctrl M | Merge Layers |

**Edit Mode**
| Keymap | Operator |
| -------- | -------- |
| Shift I | Insert Blank Keyframe |
| Alt I | Delete Animation (menu) |
| Shift Ctrl M | Merge Layers |
| Shift Q | Edit Lines (overlay toggle) |
| Shift Alt Q | Edit Lines Multi-Frame (overlay toggle) |
| Shift G | Vertex Groups |

**Sculpt Mode**
| Keymap | Operator |
| -------- | -------- |
| I | Animation (menu) |
| Shift I | Insert Blank Keyframe |
| Alt I | Delete Animation (menu) |
| Shift Delete | Delete Active Keyframes (all layers) |
| Shift Ctrl M | Merge Layers |
| Shift Q | Edit Lines (overlay toggle) |
| Shift Alt Q | Edit Lines Multi-Frame (overlay toggle) |
| Y | Active Layer |
| U | Active Material |
| Ctrl C | Copy Strokes |
| Ctrl V | Paste Strokes |
| Shift Ctrl V | Paste Strokes (back) |
| Shift Alt A | Automasking (menu) |

**Weight Paint and Vertex Paint Modes**
| Keymap | Operator |
| -------- | -------- |
| I | Animation (menu) |
| Shift I | Insert Blank Keyframe |
| Alt I | Delete Animation (menu) |
| Shift Delete | Delete Active Keyframes (all layers) |
| Shift Ctrl M | Merge Layers |
| Shift Q | Edit Lines (overlay toggle) |
| Shift Alt Q | Edit Lines Multi-Frame (overlay toggle) |
| Y | Active Layer |

Pull Request: https://projects.blender.org/blender/blender/pulls/128705
2024-10-15 11:35:57 +02:00
Jacques Lucke
5ad56c52ff Fix #128861: crash with Index Switch node when sliced virtual arrays are used
It looks like this specific case never really worked. This wasn't found before,
because in the large majority of cases, execution uses a more optimized code
path instead of this general one.

Pull Request: https://projects.blender.org/blender/blender/pulls/128993
2024-10-15 11:02:22 +02:00
Xavier Hallade
2cfe69c07d Cycles: Fix error handling of BVH transfer to device
Previously, in case of a failure during BVH transfer, when running out
of memory for example, we could get an error such as "BVH failed to
migrate to the GPU due to Embree library error (no error)", because
embree error status was actually reset before being queried.
This commit fixes its propagation.

Pull Request: https://projects.blender.org/blender/blender/pulls/129022
2024-10-15 10:31:30 +02:00
Campbell Barton
44d0452a78 Cleanup: spelling in comments 2024-10-15 12:51:05 +11:00
Jesse Yurkovich
9c36cfb4b8 Fix: Use error reports as indication of cancellation for some IO ops
During development of Collection Export, it was noticed that our various
IO formats deal with errors in vastly different ways [1]. The crashes
were all fixed but now the motivating scenario is as follows:

If you setup a Collection Exporter for OBJ, STL, or PLY, and if it
runs into an error during processing, the C++ operator will return
"FINISHED" to the caller but the operator will also RPT_ERROR. This
causes the caller, Collection Export, to indicate "success" to the user
but the RPT_ERROR then causes a UI report that indicates failure.

This PR chooses to use the presence of the RPT_ERROR as indication of
"CANCELLED" operator status and should be safe enough to also apply
to 4.2 LTS.

This aligns with what Python does [2] and with what the new GSoC import
nodes have chosen to do [3]. Though doing this on import isn't quite
correct so this PR does not add that in to the base import operators.

Alembic and USD are better behaved in this scenario already. However,
they have their own quirks to follow-up afterwards.

[1] https://projects.blender.org/blender/blender/issues/117881
[2] https://projects.blender.org/blender/blender/src/branch/main/source/blender/python/intern/bpy_capi_utils.cc#L25
[3] https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/geometry/nodes/node_geo_import_obj.cc#L49

Pull Request: https://projects.blender.org/blender/blender/pulls/127525
2024-10-14 22:55:20 +02:00
Sean Kim
feaa7bbbcc Fix #129013: Certain brushes can cause artifacts
Any brush that used the `restore_position_from_undo_step` codepath (i.e.
brushes that use `OrigPositionData` to calculate their deformations) had
the possibility to cause artifacts due to the nested tbb parallelization
causing incorrect usage of TLS data.

To fix this we add a call to `threading::isolate_task` to prevent thread
stealing.

Pull Request: https://projects.blender.org/blender/blender/pulls/129020
2024-10-14 22:46:30 +02:00
Sean Kim
3d40d6e188 Fix #128999: Smooth Surface brush doesn't update viewport
Missed in 347ec1acd7

Pull Request: https://projects.blender.org/blender/blender/pulls/129017
2024-10-14 21:45:12 +02:00
Philipp Oeser
0319b7b50a Fix #127611: Linked material can be modified by Copy/Paste Material
Seems like we can use `object_materials_supported_poll` (similar to
other material operators) that already checks the right things.

Pull Request: https://projects.blender.org/blender/blender/pulls/128996
2024-10-14 17:59:59 +02:00
Sean Kim
b2e0193cc1 Fix #128929: Multires face set automasking doesnt work with no face set
Introduced in 7c42c80126

Incorrect value of `1` was used for the situation where the
`.sculpt_face_set` attribute was missing on the mesh instead of
`SCULPT_FACE_SET_NONE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128939
2024-10-14 17:27:45 +02:00
Sean Kim
a205e34158 Fix #128933: Dyntopo density brush prints constant console errors
The brush does not use the value calculated from brush_strength, this
commit silences the assert by just handling the case statement for this
brush type with a static value of 0.0f.

Pull Request: https://projects.blender.org/blender/blender/pulls/128936
2024-10-14 17:23:10 +02:00
Julian Eisel
10f2d683ba Cleanup: Use dedicated string reference type for drop tooltip drawing
Followup to 682161283e.

This type better reflects the intention of a read-only string reference,
and `std::string` should usually be used for owning string variables
only.
2024-10-14 16:41:54 +02:00
Guillermo Venegas
682161283e Fix unreported: FileHandler drag-an-drop tooltip is generated in a wrong context
The tool-tip generated for FileHandler drag-n-drop may be obtained from a
different context where the dropbox poll function is invoked, which could
generated an incorrect tool-tip since FileHandlers are polled again in a wrong
context.

This can be solved by ensuring the same context is used, however the tool-tip
could be drawn in different windows.

To avoid undefined tool-tips , this generates the tool-tip in place when the
dropbox poll function is invoked.

Pull Request: https://projects.blender.org/blender/blender/pulls/125037
2024-10-14 16:39:31 +02:00
Jeroen Bakker
ceb61ac921 Fix: Vulkan: Strict extension test
VK_EXT_dynamic_rendering_unused_attachments is required for correct working.
Renderdoc hides this extension, but most platforms do work. However the
Windows Intel driver crashes when using iGPUs; they don't support this
extension at all.

This change does a more strict extension test so drivers that do not
support this extension will fallback to OpenGL. When using renderdoc it
is now allowed to compile blender with `WITH_RENDERDOC=On`.

Future developments are needed to add support for Intel iGPUs on
Windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/128986
2024-10-14 15:43:41 +02:00
Jeroen Bakker
d35cd15e12 Fix #128608: Vulkan: Sync issues when sharing context between threads
Resources are shared, when running multiple contexts on the same thread.
Cycles uses the same context on multiple threads and expected same resources.

This change will introduce a single render graph per context and an updated
resource management. Render graphs are not shared anymore; Resource pools
are still shared, but garbage collection depends on the thread and if
background rendering is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128983
2024-10-14 15:42:46 +02:00
Jeroen Bakker
fb862d082a Fix: Vulkan: Sync issue command buffers
Cycles uses multiple threads to send commands to the GPU. The current
command buffer structure assumed that all commands from the same context
were send via the same thread. This wasn't the case and could lead to
recording commands to command buffers that are still pending (preparing
commands to send to GPU).

This is fixed by creating a command buffer each time a render graph
submits its work.

Detected when researching #128608

Pull Request: https://projects.blender.org/blender/blender/pulls/128978
2024-10-14 15:41:30 +02:00
Jeroen Bakker
3b7dd61e01 Fix: Vulkan: Incorrect Host Visibility Allocation
When allocating a host visible buffer it could be that the returned
buffer was not host visible and access to the buffer would write to
unallocated memory.

Detected when researching #128608

Pull Request: https://projects.blender.org/blender/blender/pulls/128977
2024-10-14 15:39:27 +02:00
Jeroen Bakker
acb205763e Fix: Vulkan: Cycles CPU Synchronization
When using cycles in the viewport there it uses render threads and
workers to update the viewport. All threads can record commands to the
queue and needs to be synchronized. This didn't happen leading to
incorrect renders.

Detected when researching #128608

Pull Request: https://projects.blender.org/blender/blender/pulls/128975
2024-10-14 15:38:22 +02:00
Jeroen Bakker
af151e89a7 Fix: Vulkan: Unguarded Access Device Queues
Multiple threads can access the same device queue from different
threads. This could happen when doing a cycles preview render, baking
eevee volume probes or generating material previews.

This PR adds a mutex around access to the device queues.

Detected when researching #128608

Pull Request: https://projects.blender.org/blender/blender/pulls/128974
2024-10-14 15:30:11 +02:00
Jacques Lucke
2806d54320 Fix #128499: dot dash modifier crashes because of missing attributes
These attributes are not guaranteed to exist. So they should either be used
conditionally, or with a fallback value. The fallback value for the opacity is
obvious, but for the radius it's more tricky. There is not a consistent fallback
value across Blender unfortunately. The one I used here is used in a couple of
places.

Pull Request: https://projects.blender.org/blender/blender/pulls/128847
2024-10-14 14:19:24 +02:00
Pratik Borhade
373d77aeb6 Fix #128672: Brush Assets: Wrong catalogs in asset shelf by default
Mistake in `catalog_path` name

Pull Request: https://projects.blender.org/blender/blender/pulls/128681
2024-10-14 14:10:21 +02:00
Bastien Montagne
39c1127dc0 Fixes for #128078
# Fix 128078, Part I: Fix missing reverse endian switch of Action's `idroot`.

ID type code stored as ints (or shorts) need their endian switch to be
reverted (in case there is endianess conversion) on file read.
Interestingly, this was done for the deprecated IPO data (among others), but
not for the Action one!

NOTE: There is no versioning fix for this mistake, i.e. old files that
were saved from a BE system, then opened and re-saved from a LE system,
will still have totally invalid ID code values. This is not considered
as necessary currently, given that this `idroot` value is only
'informational' and not relied on by any part of the code.

# Fix 128078, Part II: GPv3 conversion code missing animation of Layers' location.

Also add code to the AnimDataConverter to ensure that actions get the
`idroot` matching their new ID owner type in GP data case.

Pull Request: https://projects.blender.org/blender/blender/pulls/128129
2024-10-14 13:59:06 +02:00
Pratik Borhade
ae1409b9ae Fix #128921: GPv3: Influence subpanel is missing in Simplify modifier
The layer/material/vertex group filter properties had already been added but they were
not exposed in the UI. Also the influence panel was missing. Now added in "rna_" function
of the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/128973
2024-10-14 13:06:07 +02:00
Campbell Barton
f8a29ccab5 Update autopep8 1.6.0 -> 2.3.1, remove outdated "toml" module
Bump autopep8 as there has been various improvements & bug-fixes.
Also update pycodestyle 2.8 -> 2.12.1.

autopep8 imported a module "toml" which has been superseded by
Python's own "tomllib". The "toml" module has been removed.

Ref !127553
2024-10-14 21:50:01 +11:00
Philipp Oeser
1246baa81b Fix #128935: Preview range to selected keyframes wrong
Depending on from where this functionality was called, it behaved
differently (there are three operators for this).

- from the GE, it uses `get_graph_keyframe_extents` [which falls back to
existing scene (preview) start/end frames if no real extends are found]
- from the NLA, it uses `get_nlastrip_extents`[which falls back to
existing scene start/end frames if no real extends are found]
- elsewhere (and this was reported in #128935) it uses
`get_keyframe_extents` but did not consider if extends were really
found.

The last case lead to startframe being set higher than endframe causing
a crash on playback.

This PR checks the return value of `get_keyframe_extents` [which tells
us if extends were found] and cancels out early.

NOTE: it would probably be nice if the behavior was consistent across
all editors, but since I think the right behavior is to not do anything
if nothing is selected (after all the description is "based on range of
selected keyframes"), I am going for correct behavior of
`ACTION_OT_previewrange_set` but leave the Graph Editor and NLA editor
operators untouched for the time being.

Pull Request: https://projects.blender.org/blender/blender/pulls/128981
2024-10-14 11:51:24 +02:00
Pratik Borhade
99b876e2bc Fix #128946: GPv3: Can't select materials in Modifier
Should have been `value.data`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128971
2024-10-14 11:20:28 +02:00
Bastien Montagne
a4ee79b3d3 I18N: Updated UI translations from git/weblate repository (46cee80daa5a3e). 2024-10-14 10:54:10 +02:00
Falk David
89e3ab2a45 Fix: GPv3: Error when calling add_points or remove_points
The `drawing.resize_curves` function had been renamed in
1899ea25d5 but this wasn't
updated in the strokes API.
2024-10-14 10:40:52 +02:00
YimingWu
dc45169acd Fix #128637: Gizmo line tool not snapping to exactly 45 degrees
Due to rounding errors in `wm_gesture_straightline_do_angle_snap`, it
could give out a snapped result that's meant to be 45 degrees but does
not have equal X/Y distances after converted to integer. Since 45
degrees can be used to make a equal length structure, it's best to make
sure that resulting X/Y values are the same if the angle is multiple of
45 degrees.

This fix would be effective for all tools that uses this "straight line
gizmo".

Pull Request: https://projects.blender.org/blender/blender/pulls/128683
2024-10-14 13:03:03 +08:00