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
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.
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
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.
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
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
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.
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.
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
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
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