Python defined asset shelfs can now define an `asset_poll__()` function
to determine if an asset should be visible or not, based on type
information. This isn't great and can probably be a performance issue in
bigger libraries. A proper solution would be to provide a set of asset
traits to filter by, but this is a bit tricky to implement. This is a
temporary solution so the brush assets project isn't held up by this.
Mandatory change for the Brush Assets project, from quick test does not
seem to break anything (more) in existing 'old' brushes...
Re. #101908.
Pull Request #105016
This adds support for cursor snapping for the new curves object.
It implements a function `transverts_from_curves_positions_create` (to separate the logic from the `Curves` object type). That function is then C wrapped by `ED_curves_transverts_create` and finally used in `ED_transverts_create_from_obedit`.
Pull Request #104967
Fixes the `-Winconsistent-missing-override` warning.
In theory the `virtual` is redundant in such case, but this is how
it is done in may other areas of USD code.
Pull Request #104977
Previously when markers were used, the newly introduced clamping code (#104516) would stop the last channel from being shown.
This patch fixes that by modifying the `v2d->tot.ymin` calculation.
This is a bit counterintuitive since the `v2d->tot` height is calculated in `action_draw.c`. But the advantage of doing it there is that it also works for the channels region.
Pull Request #104892
This does 2 things to address the ARM64 failures:
- Increases the threshold to be inline with what Cycles uses
- Disables the 2 problematic WebP variations (#105006 will track)
This adds saving and loading tests for our supported image formats.
**Saving - bf_imbuf_save.py**
There are 2 template images which are loaded anew for each file save
attempt. One is an 8-bit RGBA image and the other 32-bit. This is
required as many formats use a variety of factors to determine which of
`ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates
are constructed to have alpha transparency as well as values > 1 (or
clamped to 1 for the case of the 8-bit template).
Test flow:
- Load in an appropriate template image
- Save it to the desired format with the desired set of options
- Compare against the reference image
Notes:
- 98 references are used totaling ~3.6MB
- 10-12 second test runtime
- Templates can be reconstructed with the create-templates.blend file
**Loading - bf_imbuf_load.py**
Test flow:
- Load in each of the reference images
- Save them back out as .exr
- Save additional metadata to a secondary file (alpha mode, colorspace etc)
- Compare the saved out .exr with another set of reference .exrs
- Compare the saved out file metadata with set of reference metadata
Notes:
- 98 exr references are used totaling ~10MB
- 10-12 second test runtime as well
A HTML report is not implemented. The diff output organization is very
similar to the other tests so it should be somewhat easy to do in the
future if we want.
The standard set of environment variables are implemented for both:
BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR
Pull Request #104442
Added new function sculpt_mesh_filter_cancel in sculpt_filter_mesh.cc
for cancelling mesh filters. It currently is unused pending a
revamped modal map for mesh filter (see pull req 104718).
In the outliner, the icons for modifiers are tinted blue. This didn't
work for the geometry nodes modifier icon.
Defining the icon with the macro `DEF_ICON_MODIFIER` also
defines the appropriate theme color so it's now tinted blue
when drawn in the outliner like the other modifier icons.
Pull Request #104957
Add a per node type callback for creating node add search operations,
similar to the way link drag search is implemented (11be151d58).
Currently the searchable strings have to be separate items in the list.
In a separate step, we can look into adding invisible searchable text
to search items if that's still necessary.
Resolves#102118
Pull Request #104794
For example, the pose library add-on can now register an asset shelf
like this:
```
class VIEW3D_AST_pose_library(bpy.types.AssetShelf):
bl_space_type = "VIEW_3D"
@classmethod
def poll(cls, context: Context) -> bool:
return PoseLibraryPanel.poll(context)
```
Filtering by ID type is not supported yet.
This replaces the hack of registering a header type and the asset shelf
template to draw into that.
The tabs should be fully working themselves, however we don't filter
the asset shelf contents based on the active catalog (well, catalog
path) yet.
Includes the changes from D17164.
Essentially, I wanted to use a non-trivially-constructible C++ type
(`std::function`) inside `uiBut`. But this would mean we can't use
`MEM_cnew()` like allocation anymore.
Rather than writing worse code, allow non-trivial construction for
`uiBut`. Member-initializing all members is annoying since there are so
many, but rather safe than sorry. As we use more C++ types (e.g. convert
callbacks to use `std::function`), this should become less since they
initialize properly on default construction.
Also use proper C++ inheritance for `uiBut` subtypes, the old way to
allocate based on size isn't working anymore.
Differential Revision: https://developer.blender.org/D17164
Progress bar display the file reading (and other operations) is actually
broken in master for a while, so this won't actually be reported. Still
calculate it for once it's fixed.
Loading the asset library will create a read-only catalog service. The
read-only nature is not dealt with much in the asset catalog code, the
using code (e.g. the UI) is responsible for respecting it.
Merges the catalog definitions from all asset libraries in to the
storage of the "All" one, builds the catalog tree and refreshes data as
needed. This doesn't allow writing changes back to the catalog
definition files, so the UI probably shouldn't allow edits.
Together with the changes made in master, all this does is making sure
the assets are loaded and removed using the correct asset library nested
within the "All" library. Now full paths for the assets can be built
correctly from the asset identifier, which fixes preview loading and
drag & drop.
Now it actually loads data from all asset libraries when this is
selected. The asset representations still need to be loaded by the file
browser backend, this won't change for now.
This adds the concept of nested asset libraries, which I'd prefer to
keep as implementation detail and not expose in the API. But for now
it's needed (for the asset representation loading by the file browser
backend).
An "All" asset library can be selected in the Asset Browser and asset
view templates now, and that will load all assets from all asset
libraries. Preview loading, drag & drop and asset catalogs don't work
yet.