Commit Graph

115277 Commits

Author SHA1 Message Date
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
Hans Goudey
4587a87b6e Fix: Build error in overlay next from missing include
Switch to using FunctionRef over std::function which is generally
preferrable when the callback doesn't need to be stored for later.
2024-11-24 13:28:45 -05:00
Hans Goudey
fdb1bec6c8 Fix #130811, #130842: Non-mesh object edit mode crash evaluated mesh
The "is edit mode" checks in the draw module have been simplified
to just check the object mode. We need to be a bit more careful to
avoid retrieving the original mesh from a non-mesh object.

This commit improves the "get pre-modified mesh" function with
better comments and checks that reflect the relatively recent cases
where the original and evaluated geometry data types don't match.
It's always called with a mesh object too.

Pull Request: https://projects.blender.org/blender/blender/pulls/130850
2024-11-24 17:43:55 +01:00
Hans Goudey
705972e6af Cleanup: Workbench: Follow style guide for public class variable references
_No response_

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/130819
2024-11-24 17:37:17 +01:00
Clément Foucault
0ec7afff26 Fix #130802: Overlay Next: Crashes when selecting with Intel GPU
The shaders were invalidly marked as selection shaders.

Also fix the selection buffer / pass setup logic.
2024-11-24 15:45:50 +01:00
Clément Foucault
5f9c63963c Overlay-Next: Support selection of flat meshes in orthographic view
This workaround had not been ported over from the legacy overlays.
2024-11-24 15:29:26 +01:00
Clément Foucault
910ad6d031 Overlay-Next: Refactor flat object outline drawing
This workaround was against design and having conditional
sync depending on the view.

Now, the flat objects are put in a list and conditionally
put in a different pass at draw time.
2024-11-24 15:29:26 +01:00
Clément Foucault
08ed51d5db Cleanup: BKE: Const correctness for BKE_object_dimensions_get 2024-11-24 15:29:26 +01:00
Habib Gahbiche
35ea495bb6 UI: Nodes: Remove some snapping options
Compositor: UI: remove snapping to nodes.

Snapping nodes to other nodes behaves in a very unpredictable way, which makes most snapping options useless.

The patch removes the following:
- Snapping options `Node X`, `Node Y` and `Node XY`
- Menu `Snap Node Element`
- Menu `Snap Target`

New behavior:
- Activating `Snap` always acts as 'Snap to Grid'

Part of https://projects.blender.org/blender/blender/issues/128612

Pull Request: https://projects.blender.org/blender/blender/pulls/127667
2024-11-24 14:30:22 +01:00
Pratik Borhade
f181262634 Fix #130579: Un-isolating collection fails in presence of linked-collection
Visibility of linked collection cannot be changed after 4e907829d3 and
e494a44024. This results in failing "un-isolate" collection. To resolve
that, treat linked/overridden collections as isolated by returning true in
`outliner_collection_is_isolated()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130604
2024-11-24 06:59:40 +01:00
Pratik Borhade
8dc8e48e9a Fix #130478: Toolbar tooltips have uncentered vertical padding
Pass `is_pad=false` for title text to prevent additional space above
them.

Pull Request: https://projects.blender.org/blender/blender/pulls/130498
2024-11-24 06:51:10 +01:00
Hans Goudey
21e2fba621 Fix #130808: Crash with GPU subdivision, edit mode, and mirror modifier
Mistake in deedbee971.
We need to take into account original indices in the evaluated mesh to
extract the proper original selection state.
2024-11-23 22:12:10 -05:00
Clément Foucault
23ac825a15 Cleanup: Overlay-Next: Deduplicate global UBO binding
No functional changes.
2024-11-24 01:23:10 +01:00