Commit Graph

120055 Commits

Author SHA1 Message Date
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
Clément Foucault
37bb1dedf5 Overlay-Next: Document each overlay class 2024-11-24 01:02:55 +01:00
Clément Foucault
6e6711772f Overlay-Next: Move debug scope to capture command generation dispatch
This is more useful to track down visibility issue.
2024-11-24 01:02:55 +01:00
Clément Foucault
170277f703 DRW: Batch Cache: Avoid dummy batch creating invalid draw calls
The vertex length of the batch was 1 which lead to invalid
drawcall if trying to render triangles or lines.

Setting a length of 0 allows the GPU module to bypass the
drawcall.
2024-11-24 01:02:55 +01:00
Hans Goudey
b5f9db919b Fix: Viewer node overlay broken after recent draw extraction fix
The viewer node is not edit mode data, it should be extracted from
a final evaluated mesh (that's just the mechanism that geometry
nodes uses to get the data to the engines. The requests were probably
just added to the bottom by mistake.
2024-11-23 16:45:55 -05:00
Jesse Yurkovich
32b9f50319 Cleanup: USD: remove another dead field from ImportSettings struct
Pull Request: https://projects.blender.org/blender/blender/pulls/130803
2024-11-23 22:04:50 +01:00
Clément Foucault
702c1dc833 Fix #130756: Overlay-Next: Viewer node attributes values are not shown in the 3D viewport
Straightforward port.

Rel #102179
2024-11-23 20:22:49 +01:00
Clément Foucault
95c6a94450 Overlay-Next: Undo changes to Lattice drawing logic
The previous behavior was following legacy overlay.
2024-11-23 19:51:33 +01:00
Harley Acheson
ed6e6200d4 UI: Slightly Softer 50% Split Snap
Based on feedback from Alaska, this slightly narrows (softens) the
snapping to 50% when splitting an area without modifiers held.

Pull Request: https://projects.blender.org/blender/blender/pulls/130800
2024-11-23 19:28:08 +01:00
Hans Goudey
421e1a0c24 Cleanup: Replace some uses of GSet and GHash with C++ classes
For type safety and potentially improved performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/130796
2024-11-23 17:00:21 +01:00
Leon Schittek
13e0077c5c Nodes: Add new shader for node sockets
Add a new shader specifically for node sockets rather than using the
keyframe shader.

Motivation:
1. Allow easier addition of new socket shapes
2. Simplify socket drawing by avoiding special handling of multi-inputs
3. Support multi-inputs for all socket types (diamond, square, etc.)

The new shader is tweaked to look the same to the old ones.

**Comparison**
The biggest difference is that the multi socket is now more consistent
with the other sockets.
For single sockets there can be small size differences depending on zoom
level because the old socket shader always aligned the sockets to the
pixel grid. This could cause a bit of jiggling compared to the rest of
the node when slowly zooming. Therefore I left it out of the new shader
and it now scales strictly linear with the view.

**Multi Socket Types**
While there currently is no need for (.) internally, there are a few
obvious use-cases for multi-input field (diamond) sockets like
generalized math nodes with an arbitrary number of inputs (Add,
Multiply, Minimum etc.).

Co-authored-by: Jacques Lucke <jacques@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119243
2024-11-23 16:42:38 +01:00
Hans Goudey
b6b312d98f Cleanup: Remove unused GSet forward declarations 2024-11-23 10:07:30 -05:00
Jacques Lucke
9895ad2479 Refactor: Readfile: extract function to decode .blend file header
This simplifies the code a bit in my opinion. It also makes it easier to sneak in an
additional bit in the header for #129309.

Pull Request: https://projects.blender.org/blender/blender/pulls/129746
2024-11-23 13:15:56 +01:00
Clément Foucault
7c97978eca Overlay-Next: Add base class for documentation
Add the base `Overlay` class for documenting the methods.

This cleans up the inconsistency in the method implementation
and add TODOs for method not complying with the interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/130790
2024-11-23 13:11:01 +01:00
Clément Foucault
79b7bce125 Cleanup: Overlay-Next: Make armature method parameter consistent 2024-11-23 11:14:43 +01:00
Philipp Oeser
531ed68061 Fix #130686: Outliner vertex groups sorting is broken
Caused by 8214109778

Before said commit, a vertexgroup `TreeElement` would take its `idcode`
in a questionable way described in the commit messages of 0c0bc61918
and 0a633a4e07.

Since 8214109778 this is not the case anymore, it is just 0.

4292bb060d made this comment (guess this never happened):
>/* We need to figure out how to deal with the idcode for non-
TSE_SOME_ID types still. Some rely on it... */

So in order to return to the prior behavior, we could just enable the
following line (even for the new type design), this will work, but feels
rather shaky (the basic question here is just "do we want idcode to
point to the owner ID for something like vertexgroups?" -- still cannot
answer this question tbh.):
`te->idcode = GS(owner_id->name);`

So one of the places where the logic relied on `idcode` is alphabetical
sorting. The logic excluded some elements from the sorting (by
explicitly setting their `idcode` to zero) and this is where we now
coughing up because... well we are always having a zero `idcode` for the
new type design.

To resolve, just explicitly enable sorting for `TSE_DEFGROUP` again by
explicitly setting their `idcode` to non-zero(one).

Pull Request: https://projects.blender.org/blender/blender/pulls/130750
2024-11-23 10:51:56 +01:00
Clément Foucault
b5f11dc6e1 Cleanup: Overlay-Next: Make drawing functions name consistent
Use same naming convention as the associated framebuffers.
2024-11-23 10:37:55 +01:00
Clément Foucault
d9ab2d1598 Overlay-Next: Move view to local storage
This keeps the visibility resources alive,
avoiding recreating them for each redraw.
2024-11-23 10:37:55 +01:00
Clément Foucault
12048170c9 Cleanup: Overlay-Next: Remove unused members 2024-11-23 10:37:55 +01:00
Clément Foucault
93bfc19ef9 Cleanup: Overlay-Next: Use convenience function for overlay flags 2024-11-23 10:37:55 +01:00
Clément Foucault
aa4ae8add4 Cleanup: Overlay-Next: Use convenience function for selection mode 2024-11-23 10:37:55 +01:00
Clément Foucault
61f601e705 Cleanup: Overlay-Next: Use convenience function for space type checks 2024-11-23 10:37:54 +01:00
Ray molenkamp
87a7cab146 CMake: Fix Policy CMP0175 warning
CMake 3.31 has begun emitting CMP0175 [1] when you call add_custom_command
with invalid keywords. While `MAIN_DEPENDENCY` is a valid keyword for
`add_custom_command(OUTPUT)` [2] it is not for `add_custom_command(TARGET)` [3]

proper fix is to remove the offending parameters.

[1] https://cmake.org/cmake/help/latest/policy/CMP0175.html
[2] https://cmake.org/cmake/help/latest/command/add_custom_command.html#generating-files
[3] https://cmake.org/cmake/help/latest/command/add_custom_command.html#build-events

Pull Request: https://projects.blender.org/blender/blender/pulls/130565
2024-11-23 01:55:00 +01:00