Commit Graph

142365 Commits

Author SHA1 Message Date
Bastien Montagne
ac75e37c8e Fix #130113: Copying Object ID never copies its preview.
This was added 7 years ago as 'safe' preservation of previous behavior,
when ID copying was refactored and more control was added over its
behavior.

However, it was never removed since then, even though `NO_PREVIEW` flag
has been part of the `LOCALIZE` copying behavior since many years.

So time to remove this enforced bahevior and use the API as designed. If
this causes new issues, they will have to be fixed in code calling the
ID copy API (most likely by simply adding the `NO_PREVIEW` flag to the
copy options).
2024-11-11 16:13:37 +01:00
Hans Goudey
7f75690127 Fix #130102: Boundary brushes ignore masking with Multires
Also fixes #130100.

Mistake in 1618448abd.
2024-11-11 09:13:45 -05:00
Germano Cavalcante
b4154c6a0e Fix #130078: Snap to Grid ignored if occluded in Add Object Tool
The snap cursor internally snaps to the Face to define the occlusion of
the Grid or to calculate the "Surface" orientation set by the tool.

Even though this is not the snap point enabled by the user, this
internal Snap to Face takes precedence over the Snap to Grid that is
enabled by the user.

To solve this, the solution is to do a second snap test but now only to
Grid and using the hit point as a reference for the closest grid.

Also fixes Absolute Increment Snap not being detected as Grid by the
tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/130092
2024-11-11 14:26:52 +01:00
Lukas Tönne
72fd267024 Fix #130110: Fill tool crashes when extension lines are enabled
This was caused by ba28469e, which subtracted the start of the
offsets array, so it can't be used for "max array size" any more.
Use the "last()" entry directly to correctly size the view
positions array.

Pull Request: https://projects.blender.org/blender/blender/pulls/130127
2024-11-11 14:25:08 +01:00
Falk David
4ba7950c2c Fix: GPv3: Memory leak with empty drawings array
The `BKE_grease_pencil_duplicate_drawing_array` function
would allocate memory for an empty array. This can be avoided.
2024-11-11 14:12:07 +01:00
Pratik Borhade
68ddaa2f0a Fix #128930: Cancel resize area with Right mouse
Add RMB switch case in modal fn() to cancel area resize operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/129100
2024-11-11 12:48:13 +01:00
YimingWu
b8eb80c1fd Fix #130110: GPv3: Fill tool respect legacy radius factor
After applying fill tool, the `LEGACY_RADIUS_CONVERSION_FACTOR` was not
multiplied back so the value in the brush settings panel will become
smaller and smaller for each execution of the tool. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130120
2024-11-11 12:43:36 +01:00
Alaska
442498d53c Fix #130076: Make Grease Pencil Select Similar a callable menu
Use `WM_menu_invoke` callback to invoke menu for
"select similar" operator shortcut

Pull Request: https://projects.blender.org/blender/blender/pulls/130081
2024-11-11 12:41:55 +01:00
Falk David
7f983ae5e2 Fix #130089: GPv3: Don't use default mouse cursor if paint cursor is disabled.
The default mouse cursor would show if the user disabled the paint cursor.
This is not ideal, because the default cursor is pretty big and gets in the way,
especially for tablet users.

The fix sets the cursor to `DOT` (which is very small) when the
"Show Paint Cursor" option is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/130118
2024-11-11 12:17:50 +01:00
Pratik Borhade
83396c86fc Fix #130084: GPv3: Disable overlay does not work in sculpt mode
The cache population call was missing the "hide overlay" check.

Pull Request: https://projects.blender.org/blender/blender/pulls/130109
2024-11-11 12:08:13 +01:00
Bastien Montagne
a274c4da6c I18N: Updated UI translations from git/weblate repository (b496e6d30b168f). 2024-11-11 11:43:47 +01:00
Bastien Montagne
5caa74ebf3 Fix (unreported) mistake in code, leading to invalid memory access. 2024-11-11 11:43:47 +01:00
Clément Foucault
dafa3fb88f Fix #129019: Crash when switching from EEVEE to Cycles while rendering animation
When changing render engine, we discard the persistent data
that could be saved for all the current render instance that
exists. This is to save memory for the new renderer.

When doing so while rendering for F12, `engine_depsgraph_free`
is called after waiting for the render to finish. But this
can be called before the renderer destruction and on the main
thread.

Doing so on the main thread means that the `gpu_context` used
by the renderer cannot be bound for the sake of just receiving
the orphan buffers that the depsgraph holds. This is because
only the worker thread can make the gpu context active.

Binding the draw gpu context in this situation avoid all
possible conflict.

This is basically doing exactly what the
`DRW_render_context_enable/disable` function is doing internally
if the render engine gpu context is null.

Pull Request: https://projects.blender.org/blender/blender/pulls/129982
2024-11-11 11:29:54 +01:00
Falk David
01db47b82c Fix #129766: GPv3: Fallback to "frames" mode in build modifier for natural drawing speed
The issue was that if the `delta_time` attribute didn't exist, the drawing
would appear immediatley.
In case we don't have any drawing speed information, the fix
makes it so that we fallback to use the number of frames
to build the strokes.

Pull Request: https://projects.blender.org/blender/blender/pulls/130035
2024-11-11 10:39:23 +01:00
nutti
1c8669f8c9 Fix: sphinx_doc_gen.py syntax error while generating PyDoc
Ref !130085
2024-11-10 23:35:45 +11:00
quackarooni
ab051e1f17 Fix: GPv3: "Lineart" and "Opacity" modifier don't follow alphabetical order
The `Lineart` and `Opacity` modifier appear at the bottom of their respective
menus instead of following alphabetical order. There doesn't seem to be any
conceivable reason to do this, and it is inconsistent with how the modifiers
were laid out in older Blender versions. Fixes the order of the modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/130080
2024-11-10 12:20:31 +01:00
Lukasz Czyz
9b3108462f Fix #129925: SLIM UV unwrap with holes
Assignments to UnwrapOptions overwrote the values set by
unwrap_options_get().

Ref: !130041
2024-11-10 14:45:18 +11:00
Jesse Yurkovich
f0e2d7e5ca Fix #107696: Use correct API when importing USD mesh vertex normals
This seems like a long-standing misuse of the custom vert normal APIs.
It broke, obviously so, in 3.1 but 3.0 was also rather fragile as was
noted in the original bug report.

The `BKE_mesh_set_custom_normals_from_verts` should be the correct API
to use when loading in vert normals from external files. The current
code would yield faceted mesh shading, as-if there were no custom
normals at all.

Pull Request: https://projects.blender.org/blender/blender/pulls/130069
2024-11-09 22:18:31 +01:00
Campbell Barton
325c8c0190 PyDoc: add doc-string for addon_utils.extensions_refresh 2024-11-09 13:19:27 +11:00
Campbell Barton
63c56a5d67 PyDoc: show keyword-only signifier for all RNA functions 2024-11-09 13:19:26 +11:00
Campbell Barton
56cea4a36b Fix PyDoc: Invalid signature for functions without arguments
Ref: !130031
2024-11-09 13:17:43 +11:00
Campbell Barton
cd07e729a2 Fix #130024: addon_utils.enable(..) doesn't setup extensions wheels
addon_utils.enable/disable now handle wheels so that the functions can
be used with extension add-ons.

A new argument `refresh_handled` supports scripts handing refresh
themselves which is needed to avoid refreshing many times in cases
when there are multiple calls to enable/disable.

This is mostly useful for internal operations.
2024-11-09 11:44:34 +11:00
Jonas Holzman
574e08272c Cleanup: make format 2024-11-09 01:33:16 +01:00
Jonas Holzman
13c31f3912 Fix #129424: macOS Image Editor Copy/Paste upside down
This commits fixes a bug where the new macOS Image Editor image copy
paste feature was correctly pasting images from macOS to Blender, but
wrongly copying image from Blender to other software upside-down.
This was fixed by porting the row inversion logic present in
GHOST_SystemCocoa::getClipboardImage to the putClipboardImage function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129938
2024-11-09 01:30:03 +01:00
Campbell Barton
eb390425f3 Fix missing extensions refresh after the repository config changed
Enabling/disabling a repository was not refreshing its wheels or
compatibility data.
2024-11-09 11:10:26 +11:00
John Kiril Swenson
8bbe0bc838 Fix #129947: VSE: B to box-select on strips
d2a802d3c6 got overzealous by removing the "tweak" property which was
actually necessary to differentiate box select on click-drag vs. box
select on B. Fix by restoring the tweak property for everything but
preview keymap items (where it doesn't actually do anything).

Main reason this happened is because the original description was a bit
too cryptic, so update it to be clearer.

Pull Request: https://projects.blender.org/blender/blender/pulls/130015
2024-11-08 21:29:53 +01:00
Clément Foucault
03d31a3717 Fix #128712: Workbench: Crash dragging window to another screen
The crash was caused by the texture wrapper being out of date.
This happened after workbench finished rendering AntiAliasing and
going into blit-result-only mode. Doing so was causing a use after
free caught by ASAN.

But this only partially fix the bug as workbench render then becomes
uninitialized (black most likely) after dragging the window to the
second monitor. This is because the TAA texture gets recreated since
the new viewport resolution doesn't match the old one. But this
recreation does not tag as a viewport update so the TAA stays in
blit-result-only mode.

Detecting the viewport resolution change at the engine init level
seems the safest option for now, and it fixes the remaining issue.

To be backported to 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/130043
2024-11-08 18:47:20 +01:00
Julian Eisel
5829f215ab Fix #129347: Asset shelf tooltips jumping around
10ef436c8f sets the tooltip callback for asset shelf buttons, causing a
code path to be executed that refreshes tooltips in `UI_block_end()`.
This relied on projection matrices being stored for blocks to position
the tooltips, which were incorrect. I think this would be a general
issue for dynamically sized regions, but keeping the fix minimal for now
to avoid further issues.
2024-11-08 17:52:24 +01:00
Sergey Sharybin
e5de274faf Fix: Cycles HIP-RT compilation happens in parallel with CUDA
This was an oversight in #129945: the cycles_kernel_hiprt was not
handled in the original code, hence it was missing in the change.

Pull Request: https://projects.blender.org/blender/blender/pulls/130037
2024-11-08 17:21:20 +01:00
Falk David
589ef9ccce Fix #129542: GPv3: Layers and Groups don't generate callback to message bus
Layers and layer groups did not generate message bus callbacks.
This was a regression from 4.2. The fix adds
`WM_msg_publish_rna_prop` to (some) places where the layers/groups
change or the active one changes.

Also resolves #129539.

Note: This does not cover every possible scenario and only fixes
the regressions from 4.2. The message bus is still very unreliable
when it comes to detecting changes of properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/130039
2024-11-08 16:43:52 +01:00
Falk David
2c15c8de7c Fix: GPv3: Merge layers operator did not copy grease pencil paramters
The merge layer operator did not copy the parameters of the original
Grease Pencil meaning that it would e.g. loose onion skinning settings.
This fixes the issue by making sure to copy the parameters.
2024-11-08 16:38:07 +01:00
Falk David
6b6bd3bd8f Fix: GPv3: Groups sometimes loose their color tag
The copy constructor of the layer groups class was missing
the `color_tag`. This fixes the issue.
2024-11-08 16:36:36 +01:00
Campbell Barton
08693d05c1 Fix missing wheel refresh after updating extensions
Applying all available updates wasn't re-synchronizing wheels.
2024-11-09 00:41:23 +11:00
Campbell Barton
ec22e967ad Fix error installing extensions with wheels
Error in [0] caused versions not to match when enabling
extensions after installation or upgrade.

[0]: a3a3dda563
2024-11-09 00:41:21 +11:00
Alaska
79cb23b049 Add GPU backend to "Report a Bug" script
Adds the current GPU backend to the `Help -> Report a bug` script
when using the OpenGL or Vulkan backend. This makes it easier for
triagers to figure out if a user is using OpenGL or Vulkan
in cases the user doesn't explictly state which they're using.

Pull Request: https://projects.blender.org/blender/blender/pulls/130006
2024-11-08 14:25:35 +01:00
Falk David
f0614a4a3f Fix: GPv3: Regression when applying modifiers after recent commit
This was caused by 9a03f283e8.

The change disregarded the `orig_layers_to_apply` mask and
introduced some issues regarding clearing keyframes of deleted layers.

The fix does two things:
 * Add a `orig_layers_to_apply` set that contains the pointers of the
   original layers that we want to apply.
* Add a `orig_layers_to_clear` set that contains the pointers of original
  layers that need their keyframe cleared.

When a layer is removed during modifier execution, we don't want
the layer to be deleted in the original geometry. Instead we clear
the keyframes by deleting all the curves geometry. A layer
can be removed by e.g. using the  `Grease Pencil to Curves` node to
get curve instances, then the `Delete Geometry` node to delete
some instances, and finally `Curves to Grease Pencil` to convert back
to Grease Pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/130028
2024-11-08 13:08:58 +01:00
Jeroen Bakker
b86ed45fcb Fix unreported: Vulkan: Empty device list
The list of vulkan devices is empty. This regression was introduced by
91960b07db. Vulkan needs to initialize the
platform twice. Once when the backend starts, and the second time when
the device is selected. The device list is added when the backend
starts, but was cleared when the device was initialized, making the list
empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/130020
2024-11-08 12:29:23 +01:00
Jeroen Bakker
b2e1677b36 Fix: Vulkan: Incorrect depth on ARM devices
When gl_FragDepth is defined in the fragment shader and the depth isn't
written to the driver would reset the value to 0. This PR fixes this by
not putting the gl_FragDepth in the shader when it uses the
`depth_unchanged` qualifier or doesn't find any usage in the GLSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/130016
2024-11-08 12:27:46 +01:00
Pratik Borhade
b1bcdf8d53 Fix #130010: Fill mask crash with multires
&subdiv_ccg and node span in fill_mask_grids becomes invalid after
`BKE_sculpt_mask_layers_ensure` call (`sculpt->subdiv_ccg` pointer updated
in `BKE_scene_graph_evaluated_ensure`). To avoid this, move multires
reference and GridNode array after that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/130014
2024-11-08 11:16:00 +01:00
Sergey Sharybin
f58522fc10 Cycles: Tweak scheduling of GPU kernel compilation
This change makes it so only kernels of the same vendor are compiled in
parallel. For example for the release builds it will be:

1. All CUDA kernels
2. All OptiX kernels
3. All HIP kernels
4. All OneAPI kernels

This potentially leads to a lower CPU utilization, but it makes it much
easier to manage memory usage and tweak per-vendor concurrency.

The goal of this change is to solve occasional out-of-memory during the
GPU kernels compilation step on the CI/CD farm.

This change also includes tweaks to the prallel jobs for HIP-RT and
oneAPI. The tweak is based on measuring apparent memory usage peak on
Linux when doing single-thread compilation, and giving some safe margin
from the available memory on the buildbot.

Pull Request: https://projects.blender.org/blender/blender/pulls/129945
2024-11-08 11:05:38 +01:00
Lukas Tönne
449e7229f3 Fix #129749: Use consistent GPv3 color settings in different modes
Always use the Brush.color setting in the Draw mode side bar.
Technically the "Color" panel in the sidebar can draw in other modes,
but it's polling for explicit tools that limit it to the Draw mode
implicitly.

Use the appropriate brush or unified color in other GP modes based on
the unified paint settings flag.

Worth noting this was technically broken for a long time:
The default was that unified paint is disabled, so the GP panels would
use the brush color as expected. Enabling unified paint would then break
the colors, probably wasn't done very frequently since GP files
and e.g. mesh sculpting don't mix often. The default was changed in
#129127 to enable unified paint by default, which now breaks GP colors
by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/129790
2024-11-08 10:21:24 +01:00
Lukas Tönne
9a03f283e8 Fix #129346: GPv3: Merge layers into correct groups when applying modifier
Applying a modifier on Grease Pencil objects tries to maintain the
original layer order by inserting each layer after the previous. This
ignores layer groups and all layers get move to the root group.
This patch replaces the simple `previous_node` with a per-group pointer
map, which maintains order within each group only.

The code is also creating new layers when the original node of the same
name is a group. This was creating duplicate names which are not allowed
and break various things (layer editing buttons, panel open/close
toggles, etc.). Now these new layer names are made unique to avoid a
name conflict.

One remaining issue is that mixed layer/group ordering is lost: All the
layers get pushed to the bottom of the stack, due to the way
`geometry::merge_layers` ignores layer groups. The existing groups in
the orig data are not sorted along with the evaluated layers, so they
move to the top of the stack. This requires changes to `merge_layers`
and should be handled separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/129943
2024-11-08 08:28:06 +01:00
Pratik Borhade
0fd2c747fc Fix #126076: GPv3: Strokes in multi-frame mode always use onion skinning colors
`grease_pencil_layer_final_tint_and_alpha_get` wrongly sets custom
 onion skinning color to "gpLayerTint"

Pull Request: https://projects.blender.org/blender/blender/pulls/129960
2024-11-08 08:12:31 +01:00
Campbell Barton
67865cb73a Tests: add tests to ensure literal paths are properly handled
Add tests to ensure literal paths are handled properly
(created as part of the fix for #129724).
2024-11-08 16:08:38 +11:00
Campbell Barton
4be66511de Extensions: quote paths in error messages, improve missing file error 2024-11-08 16:08:38 +11:00
Campbell Barton
ae5f5c5bca Fix #129724: building extensions fails with non empty paths 2024-11-08 16:08:38 +11:00
John Kiril Swenson
2c10fe4158 Fix: VSE: Make "connect strips" default
Implementation in #124333 had versioning code in `versioning_userdef.cc`
to make sure that updated configs would also have connected strips by default,
but forgot to change `userdef_default.c`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129993
2024-11-08 05:45:58 +01:00
YimingWu
54d957a44e Fix #129873: GPv3: Missing material name overlay
The option of showing material name overlay is present but the feature
was missing in GPv3. This fix adds material name overlay back for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/129936
2024-11-08 05:05:32 +01:00
Sean Kim
5c880a5291 UI: Revert default brush icon to monochrome version
Earlier in the brush assets project, for mesh sculpting, grease pencil,
and curves sculpting, the toolbar brush icon used was changed to a
version with a green highlight. This commit reverts that change to use
the monochrome grey icon instead in each of these modes.

For Sculpt mode specifically, the Paint tool icon is kept as this green
version to differentiate the usages. In future releases, further changes
are planned for sculpting related brushes to better represent their
functionality.

---

### Sculpt Mode Toolbar

![image](/attachments/f1575814-88f0-44f7-8ab6-7b069ff09763)

Pull Request: https://projects.blender.org/blender/blender/pulls/129934
2024-11-07 22:13:58 +01:00
Falk David
761f075f8d Fix #128280: GPv3: Realize instances doesn't copy grease pencil parameters
In `execute_realize_grease_pencil_tasks` we create a new `GreasePencil`
but don't copy the parameters of (one of) the source grease pencils.

The fix adds `BKE_grease_pencil_copy_parameters` to copy the parameters
of the last src grease pencil.

Note: `BKE_grease_pencil_copy_parameters` copies the materials array. We
might want to remove this and always do the copy of this using a separate
function because some callers need their own way of copying them.

Pull Request: https://projects.blender.org/blender/blender/pulls/129977
2024-11-07 18:33:24 +01:00