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
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.
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
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
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
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
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.
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.
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
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
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`.
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
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
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
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.
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.
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
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
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
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
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
Retiming was drawn for all strips in one draw call. During strip
transformation, if strips overlap, one strip should cover the other.
But all keys were drawn on top.
Retiming drawing API was changed to draw 1 strip, so overlapped strips
can be drawn first, followed by overlapping strips.
Since retiming drawing is also layered, single draw call was split into
drawing continuity line, keys and speed text.
Our icon sources currently include two versions of the Blender logo,
the official one and one that is modified to align better to our
smallest pixel grid. But with our recent change to SVG icons, and
alignment tweaks to the official version this can be used in all
cases. This PR does so, removes BLENDER_LARGE, and also slightly
tweaks FILE_BACKUP and FILE_BLEND to use the official form.
Pull Request: https://projects.blender.org/blender/blender/pulls/124179
The BLI_spin APIs use a `SpinLock` typedef whose underlying type is
contingent on the precense of `WITH_TBB`. Since our projects did not
consistently define the `WITH_TBB` definition, multiple `SpinLock` types
would end up in our final binary creating ODR violations.
Pull Request: https://projects.blender.org/blender/blender/pulls/124285
The `WITH_TBB` define needs to be set in order for code using the
various parallel threading helpers [1][2] to actually be multi-threaded.
The affected projects did not have `WITH_TBB` defined and were using the
single-thread variant of all affected APIs.
Additionally, in the case of `EnumerableThreadSpecific`, this results in
an ODR violation where there are 2 versions of the same class linked
into our final binary. One with TBB members and one without.
--------
[1] Namely code using the `BLI_task.hh`, `BLI_sort.hh`, and `BLI_enumerable_thread_specific.hh` headers
[2] `EnumerableThreadSpecific`, `parallel_for_each`, `parallel_reduce`, `parallel_invoke`, `isolate_task`, `parallel_sort`
Pull Request: https://projects.blender.org/blender/blender/pulls/124283
- Put them in the undo namespace, since they're quite tied to the undo system.
- Retrieve the nodes inside the functions, since they always need to act on
all leaf nodes conceptually anyway.
- Expose the position restore function publicly for use in the transform tool.