Commit Graph

117289 Commits

Author SHA1 Message Date
Hans Goudey
205d95107e Cleanup: Miscellaneous changes in draw_pbvh.cc
Reorganization to make the retrieval of data from the arguments struct
more explicit, combined with a bit of renaming. Mostly to make a future
diff visually simpler.
2024-08-23 10:18:38 -04:00
Clément Foucault
e673e89630 GPU: Add support for shader printf inside tests 2024-08-23 16:11:28 +02:00
Clément Foucault
65efde82c3 EEVEE: Update shadow finalize test 2024-08-23 16:11:28 +02:00
Julian Eisel
c0b725b2ff Cleanup: Paint: Use getter to get active brush
Only paint code and brush management code should access this member
directly. Normal code should just use the getter.

Case in point, !125449 might make the querying of the active brush more
involved, so the getter should definitely be used to avoid accessing the
wrong brush.
2024-08-23 16:03:55 +02:00
Pratik Borhade
c4c4b842e7 Fix #126637: GPv3: Eraser size is the same size of Brush size
Instead of using the radius of the draw brush when activating the temporary
eraser, use the radius of the eraser brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/126673
2024-08-23 15:36:09 +02:00
Jeroen Bakker
d48986eec9 Fix: Vulkan: EEVEE irradiance baking
Fix crash when using EEVEE irradiance baking. When reading back the
intermediate result the active rendering was not ended, resulting
in an assert as the rendergraph is cleared and assumed to be in an
initial state (not rendering).

Pull Request: https://projects.blender.org/blender/blender/pulls/126688
2024-08-23 14:45:40 +02:00
Lukas Tönne
e42b9a73be Fix: GPv3: Outline perimeter cap radius too small when points are not coplanar
Stroke outlines are used by modifiers, fill tool, exporters, etc. When
the input strokes are not co-planar (different depths from camera view)
the end caps have smaller radii than they should have.

When generating the outline caps the normal vector is created from
the point tangents in 2D (after projection). When points have different
depths (Z positions) the tangents have a non-zero Z component as well
and discarding it leaves them unnormalized, thereby scaling the radius
by an unwanted factor.

Normalizing the vector fixes the issue. Object scale is now also taken
into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/126687
2024-08-23 14:24:39 +02:00
Jeroen Bakker
6607d66274 Fix: EEVEE crash when baking light probes
Due to recent changes EEVEE crashes when baking light probes.
Film checks if the viewport compositor is enabled via
DST. In the baking thread this is not initialized and can crash
or lead to incorrect results.

Fixed by first checking if we are updating the viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/126685
2024-08-23 14:20:42 +02:00
Jacques Lucke
901cfac08b Fix #126568: add dropped asset collection to active collection
This is necessary for the case where we don't add an instance for it afterwards. The collection is always added, but it may be removed again in `collection_drop_exec` if "Instance" is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/126648
2024-08-23 12:49:04 +02:00
Bastien Montagne
c23bbadebf Refactor: I18N: Use C++ in msgfmt utils.
This makes the code somewhat simpler, and fixes theoritical memory leaks
reported in #120767.

MO binary ouptut was compared as identical with the one from previous
code for a few of out current PO files.

Pull Request: https://projects.blender.org/blender/blender/pulls/126682
2024-08-23 12:41:57 +02:00
Jacques Lucke
808119ec3b Fix: linked objects are moved
Found while investigating #126568.
2024-08-23 12:41:35 +02:00
Lukas Tönne
cda6f1721a Fix #126607: GPv3 SVG import has wrong object transform and missing gradient color
The imported GP object should start out in default X/Z plane
orientation. The `EulerXYZ` function expects radians.

Gradient colors are not supported by Grease Pencil. GPv2 was simple
ignoring them and using the `NSVGgradient` pointer as a "color" value,
leading to effectively random colors. GPv3 was outputting black instead,
but that is easy to mistake for a deliberate color. This patch computes
an average gradient color as an approximation, and also generates a
warning for the operator when gradients are encountered.

Using magenta as a visual indicator is also a possibility, but this
proxy color seems to work pretty well.

Pull Request: https://projects.blender.org/blender/blender/pulls/126650
2024-08-23 11:35:09 +02:00
Christoph Lendenfeld
51fd355c01 Anim: UI template for Action selectors
This PR is just taken over from @dr.sybren with
minor comments addressed.

Original PR: #125493

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/126561
2024-08-23 11:07:16 +02:00
Nathan Vegdahl
02e721275f Fix: make convenience array functions allocate the right type
The functions were allocating arrays of `T *` rather than `T`, and
then were reinterpret-casting to the correct type afterwards. This
coincidentally worked at the current call sites because `T` was always
a pointer type anyway, but the code was logically incorrect and wouldn't
work if anyone tried to use them with a non-pointer `T`.

This commit fixes this by correctly allocating an array of `T` instead,
and removing the unnecessary cast.

Pull Request: https://projects.blender.org/blender/blender/pulls/126656
2024-08-23 10:53:36 +02:00
Falk David
f1972deba1 View3D: Allow 3D cursor to snap to grease pencil geometry
The `Surface Project` option for setting the 3d cursor location ignored
grease pencil geometry. Since grease pencil is now it's own object, separate
from annotations, it makes more sense to now consider grease pencil objects.

This changes the `V3D_DEPTH_NO_OVERLAYS` to also render grease pencil.
If grease pencil shouldn't be considered, the `V3D_DEPTH_NO_GPENCIL`
flag should be used instead.

Note that annotations are independent of the `eV3DDepthOverrideMode`.
It seems like they are always rendered according to
`drw_draw_show_annotation()`.
The description for the options in `eV3DDepthOverrideMode` is
updated to reflect that.

Resolves #122700.

Pull Request: https://projects.blender.org/blender/blender/pulls/122705
2024-08-23 10:52:19 +02:00
John Kiril Swenson
a21a1a7b86 VSE: Set "box select" default tool for preview and show toolbars
Current default tool is "sample" which is a bit odd, and coupled with
the fact that the toolbar is hidden by default, this can be confusing
to new users, leading them to believe tweak/select tools are not
supported for the VSE preview.

This change:
- Sets "box select" as the default tool for the Preview
- Makes both Preview and Timeline toolbars shown by default

Pull Request: https://projects.blender.org/blender/blender/pulls/126336
2024-08-23 09:15:38 +02:00
Campbell Barton
46cd88f229 Fix #69164: Gizmos miss undo step
Gizmos adjusting properties missed an undo step.

When auto-keying is enabled this could crash on undo, see: #126617.
2024-08-23 15:06:29 +10:00
Campbell Barton
d254a0886e WM: use the gizmo-group type name for undo steps
Use a more meaningful name than "Gizmo" in undo steps.
2024-08-23 15:06:27 +10:00
Campbell Barton
5387605833 WM: prevent tweaking a gizmo performing an undo push when canceling
Canceling an action should never add an undo step.
2024-08-23 15:06:24 +10:00
Campbell Barton
a4667fbb3d Cleanup: use bool instead of int for a boolean array 2024-08-23 13:16:26 +10:00
Campbell Barton
878b52c072 Cleanup: quiet unused variable warning 2024-08-23 13:10:36 +10:00
Campbell Barton
bfd9b4dcc8 Cleanup: use "r_" prefixed return arguments 2024-08-23 13:09:20 +10:00
Campbell Barton
761b733787 Core: set the 'errno' on *nix when BLI_delete_soft fails
Gives a more detailed report for why BLI_delete_soft fails.
2024-08-23 12:28:27 +10:00
Campbell Barton
dc5ac1e1b1 Cleanup: minor clarification for delete_soft fork use on *nix
Order the child-process before the parent-process to match the order
the logic is executed.
2024-08-23 12:28:27 +10:00
Harley Acheson
6792d6dfbe UI: Docking Snapping
While docking, by default a snap to 50%. Pressing Alt gives greater
control without snapping to center. Pressing Ctrl snaps to eights.

Pull Request: https://projects.blender.org/blender/blender/pulls/126669
2024-08-23 03:02:08 +02:00
Campbell Barton
2ef76b89e4 Cleanup: remove duplicate code-comments 2024-08-23 10:19:53 +10:00
Campbell Barton
b76fcc3a1f Cleanup: add missing headers to CMake's file listing 2024-08-23 10:19:53 +10:00
Campbell Barton
07b11206eb Cleanup: sort cmake file lists 2024-08-23 10:19:53 +10:00
Campbell Barton
fdd0b93cfa Cleanup: spelling in comments 2024-08-23 10:19:53 +10:00
Hans Goudey
d5e591b3dc Refactor: Sculpt: Add helper function to access all BVH nodes
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
2024-08-22 23:37:10 +02:00
Hans Goudey
0ff0e41c62 Cleanup: Sculpt: Remove unnecessary function prefixes in sculpt_pose.cc 2024-08-22 17:31:16 -04:00
Hans Goudey
fb7496f325 Cleanup: Sculpt: Simplify local function naming in sculpt.cc
Mostly remove the `sculpt_` prefix which is redundant in this file.
2024-08-22 17:24:14 -04:00
Sean Kim
c394aa9cea Cleanup: Add r_ prefix for ED_view3d_global_to_vector
Pull Request: https://projects.blender.org/blender/blender/pulls/126666
2024-08-22 23:23:50 +02:00
Hans Goudey
49409bdc89 Refactor: Sculpt: Simplify geodesic distances API
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.
2024-08-22 16:45:56 -04:00
Hans Goudey
e371822c9a Fix: Sculpt: Crash after recent BVH tree positions/normals refactor
The Mesh normals update still has to run even if there are no tagged
nodes, because the vertex might be tagged dirty if the mesh has only
flat faces.
2024-08-22 16:43:23 -04:00
Hans Goudey
c7b4e3e71a Refactor: Sculpt: Remove SubdivCCG pointer from BVH tree
Part of #118145.
2024-08-22 16:07:16 -04:00
Hans Goudey
24809baf2b Cleanup: Remove unused variables 2024-08-22 15:26:32 -04:00
Hans Goudey
5fdf7deb57 Sculpt: Remove duplicate BVH tree positions storage
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
2024-08-22 21:00:25 +02:00
Harley Acheson
810687ad5b UI: Improvement to Screen Area Options Menu Invoke Area Join
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
2024-08-22 20:25:51 +02:00
Harley Acheson
1d1ea87617 UI: Fix Docking Multi-Window Highlighting
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
2024-08-22 19:38:01 +02:00
Nathan Vegdahl
df02e7a5e5 Anim: add channel groups to layered actions
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
2024-08-22 17:13:12 +02:00
Lleu Yang
166c921a44 UI: Add Frequency unit
This adds the unit of frequency Hertz (Hz) and Kilohertz (kHz) for
expressing pitch of a sound.

This will be used for the ongoing Sample Sound node in #122228.

Pull Request: https://projects.blender.org/blender/blender/pulls/125915
2024-08-22 17:05:48 +02:00
Hans Goudey
549d137eb7 Refactor: Paint: Replace "CoNo" struct with separate arrays
This is similar to how this data is processed/stored elsewhere.
2024-08-22 10:50:50 -04:00
Omar Emara
758401c672 Fix #126567: Packed images are missing meta data
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
2024-08-22 16:46:50 +02:00
Hans Goudey
bda0c27c05 Refactor: Sculpt: Deduplicate topology falloff creation in expand tool
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.
2024-08-22 09:52:54 -04:00
Hans Goudey
6e845f54c3 Fix #126464: Subdiv optimal display edges causes broken wires on Metal
Caused by d1049f6082.
The old 255 FORCE_HIDE value converts to 1.0f as a float, not 255.0f.
2024-08-22 09:48:44 -04:00
Pratik Borhade
3a1f71c06e Fix #126624: Sculpt undo crash with shape keys
Caused by 18a7aff3e2
`search_gather()` returns vector but span is used to receive list from
function call. This results in crash due to accessing invalid data.

Pull Request: https://projects.blender.org/blender/blender/pulls/126626
2024-08-22 15:03:10 +02:00
Julian Eisel
03ae57dd8b UI: Disable "Render Active Object" for previews of incompatible object types
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.
2024-08-22 14:55:57 +02:00
John Kiril Swenson
715129bf5b VSE: ability to connect and disconnect strips in the VSE.
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
2024-08-22 14:54:42 +02:00
Bastien Montagne
ce95155b30 Fix #122757: Walk/Fly modes would not push undo step when moving an object around.
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.
2024-08-22 14:29:37 +02:00