Commit Graph

120055 Commits

Author SHA1 Message Date
Clément Foucault
c793c1ad38 Fix #130960: Overlay-Next: Curve control points are missing
It was caused by missing UBO.
2024-11-26 15:09:41 +01:00
Clément Foucault
d7d0b72be5 Fix: Overlay-Next: Null batch dereference 2024-11-26 14:51:39 +01:00
Clément Foucault
889ca87048 Fix: Overlay-Next: Null batch dereference 2024-11-26 14:45:15 +01:00
Clément Foucault
0ebfbaa463 Cleanup: Overlay-Next: Remove active_base 2024-11-26 14:36:20 +01:00
YimingWu
fc2f815b66 Fix #130513: Grease Pencil: material/vertex color pinning logic fix
When in grease pencil drawing mode, user could pin material or vertex
color to a specific brush or fill tool, but when switching tools, the
display and the logic of how those pinned material/vertex color are used
is inconsistent, leading to confusion.

The main cause of such problem is that the new GPv3 brush/fill tool is
not respecting pinning status, on top of that, user interface display
logic is also wrong. This PR makes sure that:

- Brush/fill tools respect pinning status.
- Buttons on the tool bar always display correct pinning status.
- Brush cursor will use correct color based on pinning status.

Pull Request: https://projects.blender.org/blender/blender/pulls/130968
2024-11-26 14:26:40 +01:00
Clément Foucault
986e495060 Fix: Overlay-Next: Crash when using volume wireframe
In some cases the volume wireframe batch can be null.
2024-11-26 14:23:08 +01:00
Clément Foucault
2901c4bb19 DRW: Assert non-null batch inside drawcall functions 2024-11-26 14:20:11 +01:00
Clément Foucault
41a54198bb GPU: Assert non-null batch inside drawing functions 2024-11-26 14:19:50 +01:00
Clément Foucault
7b75d06154 Fix: Overlay-Next: Broken build 2024-11-26 14:19:16 +01:00
Miguel Pozo
be6f68916a Fix #130906: Overlay: Crash
Use state.object_active directly, since state.active_base can be null.

Pull Request: https://projects.blender.org/blender/blender/pulls/130931
2024-11-26 14:09:54 +01:00
Bastien Montagne
8d0a5bf0fc Cleanup: Add some documentation comments to some Main properties. 2024-11-26 13:13:46 +01:00
Pratik Borhade
73cfa9f065 Fix #130785: Grease Pencil: Selection mask ignored in vertex paint
When point/stroke/segment selection is enabled and few elements are
selected, perform operation on them instead of entire range of editable
points. For that, pass a `is_selection_mask` boolean to
`apply_color_operation_for_mode` then get indexmask of selected points if
boolean is true.

Pull Request: https://projects.blender.org/blender/blender/pulls/130789
2024-11-26 12:21:50 +01:00
Sebastian Parborg
ee2b543da1 Fix #129921: Graph editor lacked any "frame changed" tagging
There is a different operator in the graph editor for jumping between
frames. This operator lacked the correct update tags and functions that
is in screen_ops for the other timeline editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/130924
2024-11-26 12:18:10 +01:00
Sebastian Parborg
43560ad9f7 Refactor: Make areas_do_frame_follow to be easier to parse
Also make it callable outside of screen_ops.cc.
2024-11-26 12:18:06 +01:00
Jeroen Bakker
fc5e38c9b6 Vulkan: Allow suspending/resuming of layer tracking
Layer tracking allows modifying specific layers of a bound texture to a
different layout. This was only supported when suspending/resuming was
not needed. However when using complex scenes EEVEE can trigger suspend/
resume rendering scopes. This resulted into several validation warnings
as images where in the incorrect state.

Fixes validation warnings:
- rain_restaurant.blend
- classroom.blend

Pull Request: https://projects.blender.org/blender/blender/pulls/130957
2024-11-26 12:13:52 +01:00
YimingWu
f6dec941b7 Fix #130840: Grease Pencil: Use vgroup count to guard invalid defnr
Inside legacy GP -> GPv3 conversion, legacy vertex group `def_nr` was
incorrectly guarded by the group count of each vertex, which can lead to
missing groups since not all vertices will have weights in all groups.
This fix use the total vertex group count to guard invalid `def_nr`
values.

Pull Request: https://projects.blender.org/blender/blender/pulls/130886
2024-11-26 12:11:27 +01:00
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