Commit Graph

117289 Commits

Author SHA1 Message Date
Nathan Vegdahl
c0fd193abf Anim: rename slot name to slot identifier
This PR renames `ActionSlot::name` to `ActionSlot::identifier` for both DNA and
RNA, and also renames related methods, functions, constants, and comments.

The purpose of this rename is to help make it clear that this is not a "name"
in the traditional sense, but rather is a composite of the slot name + id type
for lookup purposes.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130740
2024-11-26 12:11:06 +01:00
YimingWu
8121d47960 Fix #130771: Grease Pencil: Copy vertex group names when interpolating
Grease Pencil `interpolate_between_curves` call will correctly sample
and interpolate curves, but it doesn't add any vertex group names in the
resulting curves, some other systems that rely on `defgrop` will not
work correctly even when those vertex group attributes are in place.
Copying vertex group names to result curves solves this problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/130954
2024-11-26 12:10:04 +01:00
Nathan Vegdahl
370a11342c Anim: rename .action_slots to .action_suitable_slots
`AnimData`, NLA strips, and action constraints all have an
`action_slots` field in RNA. The purpose of this field is to list
the slots of the currently assigned action (if any) that are suitable
for the relevant ID.

However, this is not clear from the naming. In particular, given that
there is another field `action_slot` that represents the currently
assigned slot, the name `action_slots` could be easily misinterpreted
as a way to assign multiple slots at once, which is not possible.

To help clarify its actual purpose and meaning, this PR renames the
field to `action_suitable_slots`.

As a bonus, this also ends up decluttering the Python autocomplete when
looking for things related to `action_slot`.

Ref: #130892
Pull Request: https://projects.blender.org/blender/blender/pulls/130754
2024-11-26 11:40:05 +01:00
Falk David
e692c916f8 Cleanup: Grease Pencil: Draw operations
- `EraseOperation` reorder public and private sections.
 - Use default value of `false` for the `temp_eraser`.
 - `PaintOperation` constructor
2024-11-26 11:05:14 +01:00
YimingWu
00f61f0913 Fix #130904: Grease Pencil: Build modifier additive mode issues
Grease pencil build modifier additive mode has two problems that is
causing crashes and wrong build result when drawing in additive mode:

- Not assigning `dst_to_src_curve` for previously built curves.
- The way `previous_drawing` was acquired was wrong, this gives a zero
  stroke count for additive build mode, which prevented the crash while
  not in drawing mode (not on key frame), but is in fact incorrect for
  the algorithm.

This PR handles these problems and additive mode now works correctly
and without crashes while drawing new frames.

Pull Request: https://projects.blender.org/blender/blender/pulls/130952
2024-11-26 11:00:48 +01:00
Guillermo Venegas
2760def19a Fix: Vulkan: Free command pool buffers
Currently `VkCommandBuffer` are allocated with `vkAllocateCommandBuffers`,
however when the commands are submitted pointer are just reset, these leaks
are visible with just play back animations.

This frees commands buffers resolving the leaks.

Ref: #127225 Although related we should check the result as there could be more causes.
Pull Request: https://projects.blender.org/blender/blender/pulls/130203
2024-11-26 08:31:25 +01:00
Campbell Barton
9e9598877e Cleanup: balance braces in pre-processor checks
While it's correct, unbalanced braces confuses some editing operations.
2024-11-26 12:41:29 +11:00
Campbell Barton
5ef9b93d2a Cleanup: avoid variable shadowing 2024-11-26 12:41:29 +11:00
Campbell Barton
600f803922 Cleanup: pass string as a const reference 2024-11-26 12:41:29 +11:00
Clément Foucault
328a6aa506 Fix #130687: Grease Pencil: Rendering order broken
`gpModelMatrix` needed to be set by reference.
Reference needed to be float4x4.
float4x4 cannot be inside C allocated struct (alignment).
Move the `object_bound_mat` to the instance struct
to workaround this issue.
2024-11-25 23:30:00 +01:00
Harley Acheson
4ff47d85e0 UI: Improved Calculation of Width of Collapsed Node Title
Improve the positioning of node titles, when collapsed, so that they
don't overflow the gripper icon on the right and truncate incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/130936
2024-11-25 23:29:42 +01:00
Bartosz Kosiorek
5edc68c442 Fix #130244: Improved Calculation of Node Name Width
Improve the positioning of node titles so that they don't overflow
icons on the right and truncate incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/130409
2024-11-25 22:34:21 +01:00
Hans Goudey
de3a3b0d1c Cleanup: Remove unused code after recent subdiv refactor
b04ef9827a
2024-11-25 15:36:51 -05:00
Harley Acheson
1235a914cd Fix #130732: Join/Dock Tag Redraw on Secondary Participants
Joining and Docking tag the source and target areas for redrawing. But
there are times when areas are split and recombined as part of the
processes. In some cases areas that are not either source or target
must also be tagged for redraw. Especially for Outliner and 3DView as
they try to avoid full redraws with RGN_DRAW_NO_REBUILD, but needed
here.

Pull Request: https://projects.blender.org/blender/blender/pulls/130801
2024-11-25 20:14:18 +01:00
Harley Acheson
b846797074 Fix #129478: Remove Timeline Scrollbars For Tiny Areas
#126806 stopped the drawing of horizontal scrollbars when the areas
were very short. However this still left their hit areas still
active. This PR properly removes the scrollbar in this situation by
also changing the v2d.scroll flags.

Pull Request: https://projects.blender.org/blender/blender/pulls/130764
2024-11-25 19:38:39 +01:00
Bastien Montagne
4bf5a2f5cb Cleanup: PointerRNA: Remove 'C-style' zero-initializations.
These are useless now that PointerRNA has explicit default values, and
become a problem when real constructors are added to this struct. Simply
use the default empty value initialization instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/130927
2024-11-25 19:09:56 +01:00
Hans Goudey
ac0eba2d0d Cleanup: Remove unused code after recent subdiv refactor
b04ef9827a
2024-11-25 12:30:09 -05:00
Harley Acheson
0e83b9c5ee UI: Show File Name on Recent Item Tooltip
When the recent files list is shown on the Splash screen, the
horizontal size is constrained and so longer items will have their
names truncated. This PR adds the file name as the first item in the
popup tooltip.

Pull Request: https://projects.blender.org/blender/blender/pulls/130875
2024-11-25 18:19:18 +01:00
Jacques Lucke
3c4e46f067 Refactor: Blenloader: simplify API for BLO_Write_IDBuffer
This replaces the existing C API of `BLO_Write_IDBuffer` with a C++ API. This
helps because:
* No need for explicit freeing.
* Can use more generic `DynamicStackBuffer` utility instead of having a separate
  implementation of that.

Additionally, the API is changed so that a new `BLO_Write_IDBuffer` is created
for each `ID` instead of reusing the same for multiple IDs. This simplifies the
code quite a bit and allows for better use of the RAII pattern.

I expect the performance to be the same as before. In theory, there could be a
small speedup, because the `BLO_Write_IDBuffer` is not allocated separately
anymore, but that should be negligible.

No functional changes are expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/130452
2024-11-25 18:07:16 +01:00
Hans Goudey
b04ef9827a Subdiv: Start replacement of "converter" abstraction
The converter is an abstraction that takes a base mesh to be subdivided
and provides its topology information to the OpenSubdiv library. It does
this with one level of indirection: first extracting the base mesh
topology with a virtual function call per element to local arrays,
then giving the information in those arrays to OpenSubdiv.

That level of indirection also handles cache invalidation for the
intermediate data structures which optimize repeated subdivisions of a
changing base mesh with constant topology. However, these days the mesh
data is stored with simpler to compare data arrays, and we also have
implicit sharing which provides another way to detect unchanged
shared data.

As a very first step to a design where we use OpenSubdiv more directly
and don't store duplicate topology arrays for the base mesh, this PR
provides the converter with the mesh's face offsets array directly
rather than using function calls. For multires reshape the temporary
format is changed to match.

Next steps will do the same thing for face vertices ("corner verts" in
Blender lingo), edges, and creases. Then we can remove the "converter"
indirection completely, then we can work on a better cache invalidation
strategy using implicit sharing. That's a ways off though. On its own,
this PR should just reduce function call overhead a bit.

Reference #130917.

Pull Request: https://projects.blender.org/blender/blender/pulls/130241
2024-11-25 17:05:30 +01:00
Miguel Pozo
fddb9b4857 Fix #130774: Overlay-Next: Edit Mesh Weights
Ensure all framebuffer attachments are written to.

Pull Request: https://projects.blender.org/blender/blender/pulls/130912
2024-11-25 16:39:47 +01:00
Clément Foucault
9f51db041f Overlay-Next: Rename functions not following interface to avoid warnings 2024-11-25 16:07:21 +01:00
Aras Pranckevicius
377e998e39 BLI: Add pixel sampling functions with arbitrary UV wrapping modes
Implements #130836:

interpolate_*_wrapmode_fl take InterpWrapMode wrap_u and wrap_v arguments.
U and V coordinate axes can have different wrap modes: clamp/extend,
border/zero, wrap/repeat.

Note that this removes inconsistency where cubic interpolation was
returning zero for samples completely outside the image, but all other
functions were not, and the behavior was not matching the function
documentation either.

Use the new functions in the new compositor CPU backend.

Possible performance impact for other places (e.g. VSE): measured on
4K resolution, transformed (scaled and rotated) 4K EXR image:
- Nearest filter: no change,
- Bilinear filter: no change,
- Cubic BSpline filter: slight performance decrease, IMB_transform
  19.5 -> 20.7 ms (Ryzen 5950X, VS2022). Feels acceptable.

Pull Request: https://projects.blender.org/blender/blender/pulls/130893
2024-11-25 16:03:33 +01:00
Clément Foucault
e42416d067 Fix #130903: Overlay-Next: Crash using asan in Relation drawing
The cast `float4(float3&)` is invalid and was casted to
`float4(float *)` which read past the end of the vector.
2024-11-25 15:33:04 +01:00
Omar Emara
10e663e001 Compositor: Implement Defocus node for new CPU compositor
Reference #125968.
2024-11-25 16:23:23 +02:00
Omar Emara
da36ba3b8e Compositor: Implement Bokeh Blur for new CPU compositor
Reference #125968.
2024-11-25 16:20:50 +02:00
Omar Emara
c7d58d8dbc Compositor: Implement Morphological Blurring for CPU
Reference #125968.
2024-11-25 16:19:51 +02:00
Omar Emara
140e5de1f5 Cleanup: Use const for input arguments 2024-11-25 16:18:44 +02:00
Omar Emara
5a589d004a Cleanup: Remove unused variable 2024-11-25 16:17:46 +02:00
Bastien Montagne
199a59c8cc LibOverride: Add more 'state validation' code to BKE_lib_override_library_validate.
'Fixes'/works around blendfile corruption issue reported in #129762 by
allowing to open the blendfile and removing the invalid liboverride
properties.
2024-11-25 15:15:05 +01:00
Pratik Borhade
e2f378b500 Fix #130792: Grease Pencil: Locked layers creates keyframes when sculpting
Ensure layer is editable before adding keys to them inside function
`ensure_active_keyframe`

Pull Request: https://projects.blender.org/blender/blender/pulls/130896
2024-11-25 15:00:46 +01:00
Germano Cavalcante
18d758d7b5 Fix #130864: Snap toggle is enabled if operation has snap option enabled
Add the condition that snapping was not enabled via properties.
2024-11-25 10:20:18 -03:00
YimingWu
5628c4f587 Fix: Grease Pencil: Ensure no bezier curves for offset modifier
Ensure no bezier curves for offset modifier, this makes it consistent
with the rest of the grease pencil modifiers for now and we will make
bezier support for the rest of the modifiers later.

Pull Request: https://projects.blender.org/blender/blender/pulls/130901
2024-11-25 13:31:04 +01:00
Miguel Pozo
e7b7e6007f Cleanup: Overlay-Next: Doc fixes 2024-11-25 13:01:43 +01:00
YimingWu
a3bdd0ce70 Fix #130691: Grease Pencil offset modifier missing position change tag
A `drawing.tag_positions_changed();` is needed after deforming strokes,
otherwise viewport will use outdated drawing batches.

Pull Request: https://projects.blender.org/blender/blender/pulls/130900
2024-11-25 12:37:11 +01:00
Aras Pranckevicius
11a99fb2b1 Fix #130463, #114592: VSE prefetching uses wrong font for text strips
Prefetching happens on a background thread by design, and so it was not loading
any fonts and using the default monospace font.

Address this by making all font usage within VSE use "unique" BLF font objects,
and protecting concurrent access to them or their state within VSE itself:

- SeqFontMap structure to hold a mutex, file path -> font ID map (for file
  based fonts), name -> font ID map (for datablock fonts).
- seq_load_font_file, seq_load_font_mem, seq_unload_font that use the above
  instead of calling into BLF directly.
- Text effect rendering part guards with a mutex, so that font render state and
  glyph cache does not get trashed.
- SeqFontMap is global instead of some Scene-specific runtime data (e.g.
  scene->ed), because right now there's a hard max limit of total number of
  fonts (64), and if each copy of the VSE data would start to  load their own
  unique fonts, that limit could get easily reached.
- BLF font loading/unloading code is now thread safe. The rest of BLF drawing
  is still not!

If at some point in the future BLF font usage becomes thread safe, and font
drawing becomes "stateless", this whole machinery can be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130542
2024-11-25 12:15:22 +01:00
Pratik Borhade
3044980f09 Fix #130760: Grease Pencil: Group channel crash
Crash was fixed in 301b2ae183 but re-introduced due to changes done in
the commit 822907a68d : Macro to create channel for object data-block had
been moved outside of the `if` block.

Also fixes #130753.

Pull Request: https://projects.blender.org/blender/blender/pulls/130787
2024-11-25 12:05:22 +01:00
Clément Foucault
5e263a2772 Fix: Overlay-Next: Legacy curve wire display being on top edit curve
Simple drawing order issue.
2024-11-25 11:18:48 +01:00
Campbell Barton
0de8ae8046 Cleanup: spelling in comments 2024-11-25 13:24:46 +11:00
Campbell Barton
8b29a50625 Cleanup: use doxy sections following our style guide 2024-11-25 13:20:14 +11:00
Campbell Barton
ecc17b400b Cleanup: quiet enum mismatch compiler warning 2024-11-25 13:20:14 +11:00
Hans Goudey
1a133d96a7 Cleanup: Remove unnecessary function for comparing attribute names 2024-11-24 20:27:27 -05:00
Campbell Barton
0b564461cd Fix #130788: Select edge loops doesn't refresh
Regression in [0] missed setting "changed".

[0]: 093a3abbd4
2024-11-25 12:15:59 +11:00
Clément Foucault
ba074d1670 Overlay-Next: Move grid view specific data sync to draw function
This avoid sync function to be view agnostic (follow the
design principle).
2024-11-24 22:24:21 +01:00
Clément Foucault
7565b90900 Overlay-Next: Introduce ViewOffsetData to not rely on view during sync
This workaround the issue of the sync requiring a view.
This simply stores the rv3d members that are needed for
calling `view_dist_get`.

This is a workaround to avoid any difference in behavior
with legacy overlay while not violating the design principles.
A better fix would be to compute the offset differently
solely based on the `View` itself. But that would change
the display and should be done in another task.
2024-11-24 21:05:48 +01:00
Hans Goudey
b309fe6092 Cleanup: Formatting 2024-11-24 14:02:52 -05:00
Clément Foucault
e55b525c79 Overlay-Next: Remove debug print 2024-11-24 19:41:01 +01:00
Hans Goudey
ef68097161 Fix #130826: Property search crash after recent region runtime cleanup 2024-11-24 13:37:59 -05:00
Hans Goudey
66a476455b Cleanup: Improve variable name for copied region 2024-11-24 13:37:59 -05:00
Clément Foucault
d8b6b2b1b7 Overlay-Next: Make grease pencil depth plane follow design
This move depth plane computation to right before drawing.
Making sync cycles not rely on view.
2024-11-24 19:35:18 +01:00