When passing `.py` paths to the format command, clang-format paths
would be empty and operate on all paths.
Resolve by detecting cases when there is nothing to format.
Ref: !126055
Previously we often passed an empty `FunctionRef` to the generic
`search_gather` function. The plan is to refactor `search_gather`
to return an `IndexMask` along with storing leaf nodes in a separate
array. Splitting access to all leaf nodes to a separate function simplifies
this process and makes code more expressive too.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/126667
Pass the necessary data directly rather than retrieving it inside
the geodesic distance scode. And don't make finding finding
symmetry vertices a responsibility of the geodesic distances
API either. That should be done elsewhere.
When there is a deform modifier or shape keys, currently the evaluated
position array is copied to a duplicate array on the sculpt PBVH tree.
Historically most code has used this array directly, so the code has
been a bit confusing, but conceptually this is just supposed to be
the evaluated positions.
Instead of editing the BVH tree position array while sculpting, we
can edit the arrays on the evaluated mesh directly-- or the original
mesh when there are no deform modifiers.
Removing this array reduces memory usage and plays better with implicit
sharing since we don't need to unshare the attribute just to store a
mutable copy.
The remaining non-ideal part is sculpt mode's use of a specialized
crazy-space function `BKE_crazyspace_build_sculpt` for building the
evaluated position array rather than using the general system for
retrieving deformed mesh data, `BKE_object_get_mesh_deform_eval`.
This should be replaced at some point.
This change makes clear a few simplifications for sculpt normals
recomputation, because we can store the normals for all cases as
a shared cache, unifying the code paths for original and deformed
normals.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/126382
Right-clicking on an edge between editors, the "Screen Area Options"
menu has a number of items including for Area Join. When docking is
NOT enabled this gives the prior behavior of interactive join where
you can change direction and requires Enter to confirm. If docking
is enabled then there are instead instant join options but now with
a specific icon for each direction.
Pull Request: https://projects.blender.org/blender/blender/pulls/126616
When docking between multiple windows the highlight showing the icon
representing the moved area does not display correctly if the target
window differs from the source. This corrects that by using the
dpi-corrected values from the event, not win->eventstate
Pull Request: https://projects.blender.org/blender/blender/pulls/126659
This PR adds channel groups (also known as fcurve groups or action groups) to
layered actions. For layered actions, these groups belong to the `ChannelBag`s
and can vary by bag.
From a user perspective, the goal is for these to function just like channel
groups from legacy actions. However, internally they are implemented a little
differently: legacy actions store both channel groups and fcurves in a listbase,
and groups indicate what fcurves are in them with a listbase that points
directly into the larger fcurve listbase. Layered actions, on the other hand,
store both fcurves and channel groups in an array, and groups indicate what
fcurves are in them by indexing into the fcurve array.
Despite taking this different approach, we still reuse the `bActionGroup` struct
for the new channel groups, just adding the necessary fields for index-based
fcurve membership as described above.
This PR does not implement all of the functionality needed to reach feature
parity with legacy action channel groups, but implements the main core and gets
them basically working.
It's easier to list the things that *haven't* been implemented yet:
- Operators for letting the user manually create/remove/move channel groups.
- Keyframe selection in the action/dopesheet editor on channel group rows
themselves are not yet working correctly.
- Handling channel groups in legacy/layered action conversion operators.
- Making the legacy `action.groups` property work on single-layer-single-strip
layered actions.
Those are left for future PRs. Other than that, in theory everything should be
working now.
Pull Request: https://projects.blender.org/blender/blender/pulls/125774
Blender doesn't read meta data of images in case they were packed, which
make things like image Cryptomatte fail. This is because the image
loading code didn't specify meta data reading for packed images, but did
for normal images.
To fix this, we also specify meta data reading for packed images. And
while at it, move all common IB flags in the same like to avoid such
differences in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/126602
Part of #118145.
This was implemented three times before. Instead, implement it once
with an interface that can start with a varying number of vertices.
For a brief moment when switching to a maximized screen full area, the
screen context is missing its `object` it seems, until the context is
properly set up again.
Prevent the 'Context' object has no attribute 'object' by just checking
if it is available
Pull Request: https://projects.blender.org/blender/blender/pulls/125905
Object types like empties, lamps and cameras don't have geometry that can be
rendered by regular render engines. Attempting to render them for an asset
preview doesn't work.
36c5606fc3 already fixed a crash in this situation, resulting in an empty
preview. But better to entirely disallow this action, with useful feedback in
the UI.
Adds the ability to connect and disconnect strips in the VSE.
- Connected strips have an icon indicating their status, and attempting
to select one connected strip selects all other connected strips in
that chain.
- If the user attempts to connect a strip that is already connected to
other strips, that strip will disconnect itself from others before
connecting to new strips.
- Preview selection also works in bulk if multiple video strips are
connected together in the timeline.
- When adding new strips from the Add menu or the File Browser, strips
from the same file are connected by default. There's an option to
turn this off in Editing > Video Sequencer user preferences.
- It is possible to individually tweak strips/handles and ignore
connections with Alt+Click.
- This shortcut overrides the old keymap item for "Linked Handle"
selection. The property still exists if people want to use that
shortcut for its old purpose.
- To make sure that connections remain valid even after duplication,
I've added a condition to `seq_new_fix_links_recursive` that also
updates connections using the `seq->tmp` var. (A note -- I've updated
the comment for this field in `DNA_sequence_types.h` because the var
is only used for duplication now. It was once present in
`select_more_less_seq__internal` to be used for linked selection but
is gone now).
- There are also functions to cut one-way links and make sure that
all strips are bidirectionally connected after duplicating.
Pull Request: https://projects.blender.org/blender/blender/pulls/124333
In case the general 'locked in 3DView' code does not create an undo push
(e.g. because the 3DView is in camera mode, but is _not_ locked to the
camera), but the walk/fly operator does transform an object, it still
needs to push an undo step.
Resolve the following issues.
- Crash reading a string from uninitialized memory when
the default font directory was not found.
Fall back to the BKE_appdir_folder_default_or_root in this case.
- Memory leak when reading from the default font directory.
- Failure to ensure a trailing slash for the preferences font directory.
- Buffer overflow writing a trailing slash past the allocated size.
Crash when exporting selected frames due to two different reason.
frame returned by frame_at() can be null, so add a null check
before calling `is_selected()` member function.
After depsgraph update, ob_eval.data changes. So cast it to gease_pencil
every frame to avoid the crash (otherwise grease_pencil will point to
invalid memory).
Pull Request: https://projects.blender.org/blender/blender/pulls/126643
Ever since Blender 4.0 when the Principled BSDF was updated to
generally match the OpenPBR standard, it hadn't supported negative
specular ansiostropy.
Update the Principled BSDF tooltip to match this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/126644
Caused by 0f5dd1c55c
The refactor commit changed the arguments to receive a `Listbase` reference
instead of a pointer because in all use cases it was always passed.
As such the check for a `ListBase` null pointer went away.
However by removing JUST the nullptr check in this line
`if ((curves) || (flags & ACT_TRANS_LOC) == 0)`
to
`if ((flags & ACT_TRANS_LOC) == 0)`
I effectively changed the behavior.
Since `curves` was ALWAYS passed, the second condition never triggered.
With the change, this condition would always trigger, effectively only
adding the first FCurve of either location rotation or scale.
Pull Request: https://projects.blender.org/blender/blender/pulls/126642
Metal doesn't support RGB textures and the backend converts them to RGBA textures.
During the conversion missing RGB components should be set to 0 and missing A
component should be set to 1.
In the current implementation this was not the case and A components where also set
to 0.
PR should be backported to 4.2
Pull Request: https://projects.blender.org/blender/blender/pulls/126630
When only rendering the cryptomatte material layer, the meta data wasn't
exported. Note this issue is due to differences not reproducable in 4.3.
But the fix should also be applied there for consistency.
Pull Request: https://projects.blender.org/blender/blender/pulls/126631
Vulkan has different depth limits then opengl. We fix this by
retargetting the opengl limits into the limits that vulkan supports.
This is done in the vertex shader, or in the geometry shader. When
viewport index or layer isn't supported a geometry shader is added to
workaround these missing features. In this case the depth range was
could be done twice (vertex shader and geometry shader).
Pull Request: https://projects.blender.org/blender/blender/pulls/126634
Since ee1b2f53cc the ffmpeg libraries for Windows x64 are built effectively
without CPU specific SIMD optimizations. `--arch=x64` is not an architecture
that ffmpeg configure understands, so it falls back to "nothing is known,
turn any architecture specific bits off" code path.
Pull Request: https://projects.blender.org/blender/blender/pulls/126396
The issue was that the key bounds for determining if a key can be skipped
were initialized incorrectly.
The order of `rctf` is [xmin, xmax, ymin, ymax] but the values were given as
[x, y, x, y].
The correct order is [x, x, y, y]
Pull Request: https://projects.blender.org/blender/blender/pulls/126554
When execvp() failed to replace the stack, the forked process would
return to Blender's WM_main(..) loop then hang when attempting to draw
the window.
Resolve by calling _exit() when execvp fails.