I added code in #120673 that included a line that is a no op. This
removes that code, replacing it with a comment to my future self why
I shouldn't do a particular thing that could break in an unlikely
state that won't happen for a while.
Pull Request: https://projects.blender.org/blender/blender/pulls/120728
Callers to RNA_struct_name_get_alloc weren't accounting for allocation
which is unlikely as the fixed sized buffers used in these cases were
large.
- CTX_data_dir_get_ex & context_path_add_generic
would use uninitialized stack memory.
- OverrideRNAPathTreeBuilder::build_path & ensure_entire_collection
would leak memory.
Removal of an unnecessary check for hidden "dot" files on Linux/Mac.
This check is not needed here because the same call is used earlier -
in filelist_readjob_list_dir - which would have set FILE_ATTR_HIDDEN
for dot files.
Pull Request: https://projects.blender.org/blender/blender/pulls/120711
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