Commit Graph

150077 Commits

Author SHA1 Message Date
Hans Goudey
06dea7c1b2 Cleanup: Sculpt: Use C++ Array/Vector in cloth sim state 2024-07-11 14:18:32 -04:00
Sean Kim
5ddaf6dfd7 Refactor: WM: Use mval for polyline gesture
When this was originally implemented, the `mval` attribute `wmGesture`
didn't exist. This commit switches the current mouse position from being
stored in the last element of the point array to `mval`.

Pull Request: https://projects.blender.org/blender/blender/pulls/124489
2024-07-11 20:17:02 +02:00
Sean Kim
10b871a211 Fix: Dyntopo sample detail doesn't update status text
Pull Request: https://projects.blender.org/blender/blender/pulls/124494
2024-07-11 20:12:19 +02:00
Sean Kim
daee90c7cc Sculpt: Add report for invalid mode for trim tools
Pull Request: https://projects.blender.org/blender/blender/pulls/124498
2024-07-11 20:11:15 +02:00
Julian Eisel
70dc26cbef Fix: Empty tool settings with primitive tools in grease pencil draw mode
`UnifiedPaintPanel.get_brush_mode()` may return `None` when the current
tool doesn't use brushes. In the specific case of primitive tools
("Line", "Polyline", "Arc", etc) in grease pencil draw mode, the tools
actually should use brushes, but this isn't implemented properly yet
with brush assets. Still handle this case cleanly.
2024-07-11 19:28:22 +02:00
John Kiril Swenson
901f5495cb VSE: Fix strip icon drawing
VSE icon drawing is larger than previous after #123700, and has an
incorrect check if there is enough space to show them. This PR restores
uses of MISSING_ICON_SIZE and fixes the minimum size check.

Pull Request: https://projects.blender.org/blender/blender/pulls/124378
2024-07-11 19:18:13 +02:00
Julian Eisel
942cefdf91 Fix: Applying poses in asset shelf broken after own earlier fix
This mostly reverts d6e9438e60 and applies a different fix. Consuming
events here would break firing operators on these events, which is what
the pose library does. Added a comment to note this, because this is not
the first time that I want to change this return value to consume
events.
2024-07-11 19:16:57 +02:00
Jacques Lucke
6107175edb Cleanup: make format 2024-07-11 18:46:14 +02:00
Jacques Lucke
83373002d2 Cleanup: use more C++ containers in BlendfileLinkAppendContext
This replaces two members of `BlendfileLinkAppendContext`:
* `LinkNodePair libraries` -> `Vector<BlendfileLinkAppendContextLibrary *>`
* `LinkNodePair items` -> `std::list<BlendfileLinkAppendContextItem *>`

This simplifies the code quite a bit.

Making `libraries` a `Vector` works because afaik we never iterate over the
libraries while also adding new ones (which would invalidate iterators). It's
also nice, necause we use random access in some cases.
`items` can't become a vector, because afaik more items may be added while
iterating over it. So it's still a linked list now, but with a better type that reduces
boilerplate a lot.

Pull Request: https://projects.blender.org/blender/blender/pulls/124524
2024-07-11 18:44:38 +02:00
Jacques Lucke
f56a74287c Cleanup: use Map for linked_ids_to_local_liboverrides
Pull Request: https://projects.blender.org/blender/blender/pulls/124520
2024-07-11 18:44:20 +02:00
Jacques Lucke
436f4570c2 Cleanup: move weak reference map to C++
This replaces a `GHash` with `Map<LibWeakRefKey, ID *>` which simplifies the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/124519
2024-07-11 18:43:35 +02:00
Jesse Yurkovich
6ace3eb065 Merge branch 'blender-v4.2-release' 2024-07-11 08:44:58 -07:00
Jesse Yurkovich
af85fd3b22 Fix: Safely handle >4 channel float images inside IMB_dupImBuf
While investigating #124217 it was noticed that sometimes a >4 channel
ImBuf might be passed through to this api.

This would cause memory to be overwritten because the destination ImBuf
was created with only 4 channels of memory. Now we create it with the
proper number of channels.

Pull Request: https://projects.blender.org/blender/blender/pulls/124472
2024-07-11 17:44:09 +02:00
Jesse Yurkovich
7a076d26a6 Fix: Guard against null operation in ImageNode::convert_to_operations
Properly guard the conditionals inside ImageNode::convert_to_operations
against null operations.

I've duplicated the null check in order to not add another layer of
nesting in an already very deep set of conditionals.

Pull Request: https://projects.blender.org/blender/blender/pulls/124473
2024-07-11 17:43:45 +02:00
Jesse Yurkovich
a362c225c0 Fix #124479: Collection Export: Clear last-used operator properties
Collection Export and File->Export were inadvertently sharing the
"last used" operator properties.

This would cause settings that were used during File->Export to
interfere, silently, when exporting the collections. Or vice versa.

Pull Request: https://projects.blender.org/blender/blender/pulls/124481
2024-07-11 17:42:49 +02:00
YimingWu
2aa346a123 VSE: Check for scene.sequence_editor != None in UI
Sometimes context.scene.sequence_editor can be None, this fix check for
that and prevents python error.
2024-07-11 23:30:04 +08:00
Jacques Lucke
549f567743 Merge branch 'blender-v4.2-release' 2024-07-11 17:27:42 +02:00
Jacques Lucke
85760b6a13 Fix #123974: handle corrupted file missing baked data more gracefully 2024-07-11 17:25:29 +02:00
Sybren A. Stüvel
6e683e26cc Anim: Add dopesheet & graph editor filtering support for layered Actions
Add name-based filtering and graph editor visibility filter to layered
Actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/124528
2024-07-11 16:39:00 +02:00
YimingWu
d52e5e6fc0 Fix (Unreported): VSE: handle ed==null in SEQ_retiming_selection_get
When creating a new scene, ed can be null when switching to a vse
space, now will return early.
2024-07-11 22:28:43 +08:00
Jacques Lucke
c9766f31e0 Fix: handle non-array attributes when resampling curve
Previously, this code would crash when there are vertex groups which are
not stored as simple arrays. This happened e.g. in #124416.

All non-array attributes are converted to array-attributes with this change
for now, which is better than crashing.
2024-07-11 16:19:33 +02:00
Julian Eisel
d6e9438e60 Fix #124448, #115549: View Drag drop not working
Issue was that the left mouse press event was handled to activate the
dragging state, but not "consumed". So general view item handling would
attempt to force-activate it again, exiting the dragging state
immediately again.

Consume the event now, plus handle properly any similar unexpected cases
(with failing assert), where modal state would be exited because of an
unconsumed event.

Alternative solution to #124529, thanks to Pratik Borhade for finding
the root of the issue.
2024-07-11 16:15:43 +02:00
Omar Emara
acd4a85d6b Fix #124445: Sun beams produces sharp results
The Sun beams node produces sharp results when the background has an
alpha channel. That's because the sun beams samples were weights by the
alpha channel, and when the image is mostly transparent, no smooth
falloff can exist.

This is a regression in the Sun Beams redesign that took place in v3.6.
I was mislead by the fact that the alpha was multiplied to the weight.
But the original code actually multiplied the alpha of the border color,
not the sample color. So this fix essentially restores the old behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/124532
2024-07-11 16:10:50 +02:00
Omar Emara
57a6832b17 Fix #101263: Vector pass wrongly saved in File Output
The vector pass and potentially other vectors that store 4 values are
stored wrongly, in particular, the last channel is ignored. To fix this
we identify if a vector pass is 4D and store the information in the
result meta data, then use this information to either save a 3D or a 4D
pass in the File Output node.

This is a partial fix for the GPU compositor only. The complete fix for
the CPU compositor will be submitted separately as it is not
straightforward and will likely require a refactor.

Pull Request: https://projects.blender.org/blender/blender/pulls/124522
2024-07-11 16:08:19 +02:00
Falk David
5133a498b1 GPv3: Expose overlay options in UI
This exposes existing overlay options from GPv2
in the overlay settings in the 3D viewport.
2024-07-11 15:38:10 +02:00
Hans Goudey
f997d35033 Cleanup: Fix typo in comment 2024-07-11 09:06:44 -04:00
Jacques Lucke
5a4d7611f4 Merge branch 'blender-v4.2-release' 2024-07-11 15:03:07 +02:00
Jacques Lucke
1d4ef04a6d Fix #124463: crash when trying link a node to itself with swapping
The swapping code incorrectly expected the link to have a start and end.
However, this was not necessarily the case when attempting to create
a link from a node to itself. This case has special handling in
`node_link_find_socket`.
2024-07-11 15:00:02 +02:00
Sybren A. Stüvel
987972c7c2 Anim: add RNA wrappers for selected/expanded flags of Action Slots
Add two new RNA properties to `ActionSlot`: `select` and `show_expanded`.
The names were chosen to be consistent with other Blender RNA APIs for the
same things.

Ref: #124399
Pull Request: https://projects.blender.org/blender/blender/pulls/124513
2024-07-11 14:04:22 +02:00
Jacques Lucke
a473107489 Cleanup: start using Map instead of GHash in BlendfileLinkAppendContext
This changes the type of `new_id_to_item` from `GHash` to
`Map<ID *, BlendfileLinkAppendContextItem *>` which simplifies code. For this to work
nicely, `BlendfileLinkAppendContext` had to become a non-trivial type. Since it
was allocated with `calloc` before, I gave all members
zero-default-initializers.

This also changes `BKE_blendfile_link_append_context_new` so that it uses
`MEM_new` instead of allocating the `BlendfileLinkAppendContext` as part of the
memory arena, because that's the more common way to do it, and it does not seem
like saving this one allocation here makes a difference considering how this is
used.

Pull Request: https://projects.blender.org/blender/blender/pulls/124516
2024-07-11 13:54:57 +02:00
Jacques Lucke
10415d704b Geometry Nodes: support grease pencil in Join Geometry and Realize Instances nodes
Previously, grease pencil was just ignored by the Join Geometry and Realize
Instances code. Now they work by concatenating the layers of all grease pencil
geometries together. So if e.g. there are two inputs with each 3 layers, then
the output will have 6 layers. Layer attributes are kept intact.

Some important things to keep in mind:
* Grease pencil layers are expected to have unique names. Ensuring uniqueness
  requires O(n^2) currently.
* The material indices on the curves in each layer have to be remapped.

Just like with all other geometry types, the first input in the Join Geometry
node will come first in the output geometry. Since grease pencil layers are
drawn starting at index zero, that means that the first input will be drawn
first (i.e. it's at the bottom).

Pull Request: https://projects.blender.org/blender/blender/pulls/124361
2024-07-11 13:48:50 +02:00
Omar Emara
d14ad05078 Fix #124208: Cryptomatte are compressed in File Output
The Cryptomatte layers in the compositor are saved compressed and saved
in half precision in the File Output node. That's because the EXR writer
makes decision about compression and half float based on channel names.
And Cryptomatte are currently saved using RGBA channel names like other
color images.

To fix this, we follow the Cycles convention of using lowercase rgba for
Cryptomatte images, allowing them to be saved without compression and
always in full precision since they are otherwise useless.

Fixes #124208, #87988.

Pull Request: https://projects.blender.org/blender/blender/pulls/124508
2024-07-11 12:47:58 +02:00
Julian Eisel
c6885e00d3 Fix: Missing brush tool in grease pencil weight paint mode
Tools for grease pencil v3 weight paint mode weren't updated in
7b0ea0f1b4. Possibly because there was some back and forth in grease
pencil modes while this was being worked on.
2024-07-11 12:16:21 +02:00
Bastien Montagne
01484ce5d2 Fix (unreported) memoryleak in tests in some cases.
The call to `GHOST_DisposeSystemPaths` was done in `WM_exit_ex` and
_some_ of the tests' 'teardown'. But some more where missing. Issue was
only reproducible when defining `WITH_CXX_GUARDEDALLOC` cmake option.

There are several layers of issues here, this commit addresses the
first, simplest one: since `BKE_appdir` API will indirectly create the
GHOST SystemPaths data, it is simpler and more logical to move the
deletion of this SystemPaths data in `BKE_appdir_exit()`. This avoids
exposing a fairly low-level implementation detail all over our codebase.

Further more, `WM_init` also does not need to explicitely call
`GHOST_CreateSystemPaths`, since it will be created automatically when
required.
2024-07-11 12:06:14 +02:00
Julian Eisel
94d4864fa8 Fix: Asset shelf quick tooltips not showing
Since 4a9e8087a7, preview-tile buttons are non-interactive by default,
so tooltip handling is not triggered. Instead, attach the tooltip to the
underlying view-item button.
2024-07-11 11:58:02 +02:00
Christoph Lendenfeld
907c49da08 Anim: Operator to convert a legacy action to a layered action
This commit creates an operator to convert a `legacy Action` into a `layered Action`.
No data is destroyed, the operator creates a new datablock.
The conversion to the `layered Action` is lossless.

Pull Request: https://projects.blender.org/blender/blender/pulls/122043
2024-07-11 11:57:26 +02:00
Jeroen Bakker
a730454c8a Vulkan: Add test case for render graph draw
Pull Request: https://projects.blender.org/blender/blender/pulls/124507
2024-07-11 11:38:36 +02:00
Jeroen Bakker
82e56ca200 Merge branch 'blender-v4.2-release' 2024-07-11 11:10:14 +02:00
Jeroen Bakker
b9e15791f9 Fix #123052: EEVEE: Metal/AMD artifacts depth of field
This patch, provided by James McCarthy, removes artifacts on
Metal/AMD platforms when using depth of field.

Pull Request: https://projects.blender.org/blender/blender/pulls/124389
2024-07-11 11:09:36 +02:00
Sergey Sharybin
2a71c345d0 Merge branch 'blender-v4.2-release' 2024-07-11 11:08:12 +02:00
Sergey Sharybin
69e00c865d Fix #124217: Crashes with certain multi-layer/multi-part EXRs
Caused by a060e96103

This change restores the old behavior of pass name detection from
channel name prior to the offending commit.

The fix includes regression test based on the files from related
reports, to help catching possible issues in the future.

Being so close to the release this commit restored behavior prior
to the previous fix. Potentially this makes some files to detect
wrong pass name for some specific files, although it is not really
clear if such files exists in the wild.

Pull Request: https://projects.blender.org/blender/blender/pulls/124458
2024-07-11 11:04:08 +02:00
Omar Emara
f954a6b5fb Compositor: Support meta data in GPU compositor
This patch adds support for meta data in the GPU compositor much like
the mechanism that already exist in the CPU compositor. Only Cryptomatte
meta data is handled at the moment because that is the only meta data
that the compositor supports.

The is_data member of the result was moved to the meta data structure for
consistency with the CPU compositor.

Fixes #124222.

Pull Request: https://projects.blender.org/blender/blender/pulls/124460
2024-07-11 11:03:03 +02:00
Sybren A. Stüvel
e5ef601cd9 Anim: give the dependencies_id_types for Actions a value dynamically
Instead of hard-coding `IDType_ID_AC.dependencies_id_types =
FILTER_ID_ALL`, which is overly broad, determine its value dynamically
in `id_type_init()` so that it's purely based on which `IDType`s
identify as 'animatable'.

This should make things like ID remapping a bit more efficient, as the
remapping code knows that an Action will only reference animatable
data-blocks.

Note that the initial value for the filter is still `FILTER_ID_ALL`,
so that in cases where (by accident) the call to `BKE_idtype_init()`
is omitted, semantically the situation is still correct. Not calling
this function is an easy to make oversight when writing unit tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/124357
2024-07-11 10:49:49 +02:00
Campbell Barton
c4ed24ce9f Merge branch 'blender-v4.2-release' 2024-07-11 17:57:00 +10:00
Campbell Barton
569ccbec59 Merge branch 'blender-v4.2-release' 2024-07-11 17:56:58 +10:00
Campbell Barton
319684d8f6 Extensions: warn when extensions violate module policies
As each extension has it's own package, any modules it includes must be
imported as sub-modules. Warn if extensions are including themselves
in the sys.path as this breaks name-spacing of extensions.

Show these warnings in the add-on & extensions UI.
2024-07-11 17:50:30 +10:00
Campbell Barton
0bfea7caea Extensions: fix error it tests where the local repo wasn't cleared
Tests interfered with each other because the local repo path wasn't
cleared between different tests.
2024-07-11 17:37:31 +10:00
Jeroen Bakker
5705065db1 Fix: GHOST: Incorrect check for compilation with wayland 2024-07-11 08:34:30 +02:00
Richard Antalik
af1a6d048d VSE: Simplify outline parameters definition and usage
Function `strip_data_outline_params_set()` was simplified, so setting
color and outline parameters are not mixed and overwriting as code flows
and so the function is better readable.

Shader code is changed, so that when strip overlaps other strip, it gets
2 px red outline regardless of whether it is active or selected. This
makes it more consistent when strip is not active or selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/124442
2024-07-11 07:38:02 +02:00
Campbell Barton
fa46ed2c98 Merge branch 'blender-v4.2-release' 2024-07-11 14:23:41 +10:00