Previous code would re-create a node-tree everytime conversion code was
called (on main file read, but also on all link/append operations).
Worse, it would assing a local generated nodetree to converted linked
GPv3 objects.
This commit solves both issues in a similar way as what was done for the
legacy mesh 'auto smooth' generated node tree.
It also slightly refactors the conversion code by adding a single struct
containing all 'runtime' conversion data (two mappings currently). This
struct is then passed to internal conversion functions as reference.
The creation of a special nodegroup for the legacy 'auto smooth'
conversion used to handle 'setting the library' part itself.
Use instead the recently introduce `in_lib` variants of ID creation API.
On top of simplifying the code, this commit also fixes 'linked'
generated nodetrees always getting a `.001` suffix added to their names.
Essentially this avoids the file browser entry cache mechanism for when
we only want the list of assets, and don't need the preview image. The
speedup should become bigger the bigger the asset library is, see #120494.
When iterating over assets, we would do that through the `AssetHandle`
type, which is just a wrapper around a cached file in the file browser
backend (for historic reasons). So first we'd have to ensure this entry
is actually cached, which involved some lookups and a bunch of
allocations, which would easily add up.
In fact, for as long as we don't need the asset-handle (usually to get
the preview), we have the needed data easily available already, without
requiring a cached file in the file browser backend.
See the pull request for benchmark results.
Pull Request: https://projects.blender.org/blender/blender/pulls/120699
Factors out utility function "does the path contain any hidden file/folder
components?" function out of innards of UI code (edit_file,
is_hidden_dot_filename) into a BLI function BLI_path_has_hidden_component
and then:
- Adds unit test coverage to it, which uncovered some inconsistencies
- Fix the behavior inconsistencies:
- A path component that is just a dot (.), was not considered hidden.
Unless it was the first folder component (now this is fixed).
- A path component that ended in a tilde (~) was considered hidden.
Unless it was the first folder component (now this is fixed).
- Speedup the function by not doing several recursive scans over the
string; instead all the logic is done in a single string scan.
Synthetic HasHiddenComponents_Performance test: 6.0s -> 1.1s for 50M calls
on Mac M1 Max.
More real world test (setup as in #120494): out of whole build_catalog_tree
time, the time taken by BLI_path_has_hidden_component drops from 37% down
to 28%
Pull Request: https://projects.blender.org/blender/blender/pulls/120541
* Remove embossing from preset / export / delete buttons.
For example modifiers also don't have emboss for X, and presets
never do. So it seems consistent.
* Remove duplicated preset buttons, only have the one in the header
like other panels in properties editor.
* Use property separate layout without boxes for file path.
* Show info message when exporting a single or all collections,
otherwise it's not obvious that something happened when clicking
the button.
Pull Request: https://projects.blender.org/blender/blender/pulls/120667
The selection engine renders `uint` texture where each element of the
geometry is represented as an index.
When the geometry have modifiers, the original index was used for the
texture.
However this is not necessary for the select engine to work. The real
mesh indexes can be used in the texture and, only at the end, the
original index can be retrieved on the CPU itself.
Advantages of this approach:
- Optimizes the code to generate selection buffers.
- Makes the select id texture more informative as it identifies the
real elements instead of the original ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/119977
Resolves GPU hang caused by erroneous processing of
directional lights which should not cast shadows.
Resolves GPU hang with the Tree Creature asset and
could possibly resolve#120038.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120696
Previously all shaders had its own descriptor set layout handle. This makes it
difficult to see if currently bound resources can be reused when switching shaders.
To work around this limitation, the vulkan backend rebound the resources over
and over again.
This PR is part of the render graph where changing shaders can reuse previous
bound resources. This PR only makes sure that the layout handles are the same
so we can identify 'compatible' pipelines. The behavior to limit rebinding of
resources will be added as part of the render graph in a later commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/120562
The goal is to support better search experience in the cases where we want to
explicitly influence the ordering instead of relying only on general heuristics.
We used to support this already at some point I think, but not anymore since we
started using menu-search.
The implementation is fairly straight forward. It mainly just forwards the
search weight from the menu definition to the search code through various
required steps. The main annoying thing is that changing the signature of e.g.
`uiItemFullO_ptr` is fairly involved. Even using default parameters for these
functions is a bit annoying and becomes fairly unreadable and error-prone on the
call-site. For now, I worked around this by storing the search weight on the
`uiLayout` and to copy it to the `uiBut` from there. That seems preferable until
we have a better solution for adding parameters to all the `uiItem*` functions.
Pull Request: https://projects.blender.org/blender/blender/pulls/120572
The compositor execute functions have a `rendering` argument to specify
if the compositor is executing as part of the render pipeline. But the
render context argument is null if we are not rendering, so the
`rendering` arguement is redundant and can be removed.
Additionally, we no longer use use_file_output as a hack to detect
rendering.
Pull Request: https://projects.blender.org/blender/blender/pulls/120659
This patch improves the interactivity of the GPU compositor for
interactive node tree edits by waiting on GPU work to finish to support
more granular canceling.
This does have a performance penalty, but it does not affect final
rendering and it seems worth it because even though it is slower it will
feel faster for users.
Pull Request: https://projects.blender.org/blender/blender/pulls/120656
Add utility function to handle supported types explicitly.
Right now Blur Attribute node generates all the attribute types except for bool.
So, there is redundant instances of functions for types:
float2, int2, int8_t, ColorGeometry4b, math::Quaternion, float4x4.
These types are not supported and should not be used for instantiation.
This makes the blender binary 42 KB smaller.
Pull Request: https://projects.blender.org/blender/blender/pulls/120639
In order to improve blending of volume probes in a runtime free manner,
we need to introduce a 1 voxel padding around the volume probe data.
This offsets the actual positioning of the samples in the volume grid.
Rel #118725
Pull Request: https://projects.blender.org/blender/blender/pulls/120668
Rewrite of Scale Elements. Main changes related with removing unnecessary
abstractions (like structures of fields). Next, by using grouping approach,
all data is represented as spans. This provide ability to unify code for
different domains. Using of general utils like IndexMask, Group processing
and array utils provides much more parallelism and better memory usage.
In result, this refactoring result in 4-10 average speed improvement in
attached benchmark file with different probability and scale of elements.
See the PR for more before/after timing information and a benchmark file.
Pull Request: https://projects.blender.org/blender/blender/pulls/115142
For our built-in fonts (in our stack) we specify the Unicode page
coverage that they support, to avoid loading fonts unnecessarily to see
if they have a particular character. This way we skip over fonts to
get to symbols, etc. With our CJK (Chinese, Japanese, Korean) font
though we are using the supplied coverage bit values, which includes
more than we want. We only want to load this font for CJK-related pages
to ensure that we use more tailored fonts for other specific languages
and uses later in the font stack.
Pull Request: https://projects.blender.org/blender/blender/pulls/120676
Fall back to CPU subdivision when there are split edges and the mesh
normals domain is face corners. This is required because splitting the
normals on faces adjacent to sharp edges doesn't work well with the
performance requirements of GPU subdivision.
This is related to 1111903416
Pull Request: https://projects.blender.org/blender/blender/pulls/120674
When we iterate through glyph bounding boxes, we should ignore
combining characters, those without an advance. These types of
characters are placed over top of others, like for diacritical marks.
We never have a need to consider these, only for the parent glyph.
Otherwise mouse insertion of text cursor can occur at the wrong
location, at the edge of a diacritical mark.
Pull Request: https://projects.blender.org/blender/blender/pulls/120675
BLF function blf_str_offset_from_cursor_position returns the character
offset in a string given a horizontal cursor position. It currently has
no early exits, but can do so for no string or empty string. For negative
position values (so left of the string), do not exit out with zero but
instead act as if it were zero to ensure we test against the first glyph,
which might not be part of the character.
Pull Request: https://projects.blender.org/blender/blender/pulls/120673
The issue was that `OVERLAY_sculpt_curves_cache_populate` assumes
that the object is a curves object, which was not always the case. Now this
is checked a bit more explicitly.
The solution is still not ideal, because now the cage overlay is not shown
at all when the viewer node is used and the result is something else than
curves, but that needs to be solved separately.
- "Log Encoding with Chroma inset and rotation": add "of primaries" in
the description of the AgX Log color space to better explain the
operation, based on wording in !106355.
- Remove a few double spaces.
- Make Line Art title case everywhere, to convey it's the system /
brand / product name and not the generic concept.
- "Copy Absolute coordinates or Normal vector" -> "of Normal Vector":
typo.
- "Makes a link between selected output in input sockets" ->
"Make...", "output and input": typo.
- "Purge Unused Data From This File" -> "from this": title case as per
HIGs.
- GPencil -> Grease Pencil: no reason to use an abbreviation here.
- "Around Current Frame" -> "Around Frame": actual name of the
onion-skinning method.
- "... (layer height for layer tool, i.e.)" -> "(i.e. the layer height
for the layer tool)": put "i.e." at the start of the sentence.
- Expand description of toe-in stereo camera option.
- "Children collections their parent-collection-specific settings" ->
"Children collections with their...": typo.
- "Generate vertex weights base on..." -> "based on" : typo, lower
case.
- Expand description of GP modifier properties, based on their mesh
counterparts.
- "AEnvelope" -> "Envelope": typo.
- "Falloff type the feather" -> "of the feather": typo.
- "usually make transition as long as effect strip": rephrase.
- "When disabled a users extensions directory is created" -> "a
user's": typo.
- "successfull" -> "successful": typo.
- "Remove all attributes... a single wildcard (*).": remove trailing
".".
- "..., use "Save Preferences."": remove trailing ".".
Some issues reported by Marina Veselkova and Tamar Mebonia.
Pull Request: https://projects.blender.org/blender/blender/pulls/120649
Code was assuming that if an object had a Scene parent ID (in Outliner
context), Outliner was in Scene view and object had to be removed from
whole scene.
However, in ViewLayer view, in case an object is in a Scene's main
collection, its parent item is the scene.
Move into own BLF function, code that returns a text cursor (caret)
position given a string offset. This code is currently just in
interface_widgets.cc but should be a separate BLF function.
Pull Request: https://projects.blender.org/blender/blender/pulls/120622
The case when the tree-path of a node editor is out of date is handled more
gracefully now. Generally, one should also look into eagerly updating the
tree-path in this case, but that can be done separately.
Previously, this conversion would often result in invalid quaternions or
hit an assert in `normalized_to_quat_fast`. It's not super nice to convert
to euler as an intermediate step performance wise, but it seems to be
the easiest solution for now. Extracting rotations from matrices should
not be done all that often anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/120568
Commit 8b9743eb40 already made Blender be compiled with SSE4.2 flags
on x64 architecture, which kicked in the SSE4 code paths in
BLI_math_interp functions.
Which made them faster, e.g. in VSE on Windows/Ryzen5950X, scaling
up an image to 4K resolution:
- Bilinear 5.8ms -> 5.3ms
- Cubic Mitchell 16.3ms -> 15.7ms
This change removes the now-unneeded SSE pre-SSE4 code paths for
_mm_floor_ps, _mm_min_epi32 and _mm_max_epi32 emulation.
Additionally, including BLI_simd.h on SSE4 platform now includes
the necessary SSE4 intrinsics header.
Pull Request: https://projects.blender.org/blender/blender/pulls/120583