Age | Commit message (Collapse) | Author |
|
I'm adding some asset APIs/types in C++ that the file-listing code would
use. I prefer porting this code to C++ over adding a C-API for the asset
code.
Includes some minor cleanups that shouldn't change behavior, like using
`MEM_new()`/`MEM_cnew()`, C++ style C-library includes,
`LISTBASE_FOREACH()`, removing unnecessary typedefs, etc.
|
|
The fix is to ensure the filter for id type is run when displaying
assets from an Asset Library.
In the current implementation the id_type filter does not run if a blend
file is opened that also happens to be in an Asset Library directory. If
we have opened a blend file that is in an Asset Library directory, we
now use the same filtering check as for the "Current File" asset
library.
Differential Revision: https://developer.blender.org/D15284
Reviewed by: Julian Eisel
|
|
A new experimentatl STL importer, written in C++. Roughly 7-9x faster than the
Python based one.
Reviewed By: Aras Pranckevicius, Hans Goudey.
Differential Revision: https://developer.blender.org/D14941
|
|
|
|
|
|
Makes the File Browser filter by .obj and .mtl files by default again. Note
that this commit focuses on fixing this specific bug, further
refactors/tweaks/fixes are planned (see D14863).
Differential Revision: https://developer.blender.org/D14862
Reviewed by: Aras Pranckevicius
|
|
These were missed in previous passes. Also remove some logic
in `draw_hair.c` that was redundant after f31c3f8114616bb8964c8e7.
|
|
|
|
Follow conventions from T85728.
|
|
When filtering File Browser items by name, use entry's "name" field as
well as the "relpath" field since they can vary.
See D13940 for details.
Differential Revision: https://developer.blender.org/D13940
Reviewed by Bastien Montagne
|
|
When OneDrive files are offline, show preexisting thumbnails.
See D13930 for details.
Differential Revision: https://developer.blender.org/D13930
Reviewed by Julian Eisel
|
|
|
|
Also move eDupli_ID_Flags doc-string to it's declaration.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
Add files with extension ".woff" and ".woff2" to FILE_TYPE_FTFONT
file type. Allows selecting and using these types of font files.
See D13822 for more details.
Differential Revision: https://developer.blender.org/D13822
Reviewed by Campbell Barton
|
|
|
|
The thumbnail caching continuously sends `ND_SPACE_FILE_PREVIEW`
notifiers via a timer. But this timer was never ended properly after
thumbnails are fully loaded into the cache.
Wouldn't actually cause a refresh or redraw, send and process the
notifiers.
I already tried to avoid this for the asset view template, but
apparently that wasn't working correctly. For the File/Asset Browser I
never applied that fix to avoid possible regressions before the release.
|
|
When toggling to a File Browser from an Asset Browesr, the asset indexer
would be used to load files. I couldn't spot issues with that on a
quick look, but this should still be corrected.
|
|
Also ensure space at end of comment.
|
|
|
|
This was an issue with the mixed list of external assets and assets from
the current file. When closing the File Browser to select the custom
preview image, the assets from the current file would be cleared for
reread, to make sure we display up-to-date file data. That is because
the workspace of the temporary File Browser was deleted, causing a
change in the file data (main data-base). The reread would happen in a
background thread, meaning it might not finish before the custom preview
operator runs and queries the active asset. So the preview operator
would get the wrong active asset from context.
Two fixes were needed:
* Make sure current file data is reread before the operator runs, by
doing this partial rereading on the main thread.
* Ensure the asset list (in fact file list) order stays consistent over
rereads. If multiple assets with the same name were shown, the
operator might also have gotten the wrong asset, also leading to a
crash.
Additionally the file operation handler should probably poll before
executing, to fail gracefully at least (not crash).
|
|
Ref T92709
|
|
|
|
|
|
Changes icon used to indicate blend file when overlaid over larger
document icon when in thumbnail view. Only seen when file does not
have a preview.
Followup to {rB611e4ffaab43}
For more details and examples see D13342
Differential Revision: https://developer.blender.org/D13342
Reviewed by Julian Eisel
|
|
Asset library indexing would store indexes of asset files to speed up
asset library browsing.
* Indexes are read when they are up to date
** Index should exist
** Index last modify data should be later than the file it indexes
** Index version should match
* The index of a file containing no assets can be load without opening
the index file. The size of the file should be below a 32 bytes.
* Indexes are stored on a persistent cache folder.
* Unused index files are automatically removed.
The structure of the index files contains all data needed for browsing assets:
```
{
"version": <file version number>,
"entries": [{
"name": "<asset name>",
"catalog_id": "<catalog_id>",
"catalog_name": "<catalog_name>",
"description": "<description>",
"author": "<author>",
"tags": ["<tag>"]
}]
}
```
Reviewed By: sybren, Severin
Maniphest Tasks: T91406
Differential Revision: https://developer.blender.org/D12693
|
|
|
|
Bug introduced in {rB9d7422b817d1}.
The solution is not an init thread for preview tasks that won't complete.
|
|
Although this function only runs on the main thread, it seems safer to
clear the flag only after setting the result.
|
|
|
|
Datablocks marked as asset, linked from another file, were shown in the
"Current File" asset library. This is now resolved.
|
|
|
|
When filtering the asset browser, also include results that have partial
tag matches. So searching for "xite" will include results tagged with
"excited".
This brings the tag filtering in line with other search boxes in
Blender. Later we might want to provide users with more options for
prefix-only ("excite" would match "excited", but "xited" would not) or
only exact matches.
|
|
Due to asynchronous process, the preview for a given image may be
generated several times.
This regenerates many thumbs unnecessarily.
The solution is to add the `FILE_ENTRY_PREVIEW_LOADING` flag for file
entries that are still in the thread queue.
So this flag is checked not to redraw the thumb when it is still being
created on a different thread.
Differential Revision: https://developer.blender.org/D11150
|
|
|
|
When the file browser is in asset browser mode, it sets the callback
`filelist->prepare_filter_fn` to an asset browser specific function. This
function will segfault if there is no current asset library. Switching back
from asset browser to file browser would not reset that callback to
`NULL`, causing it to be called and crash Blender. This is now fixed.
|
|
The asset catalog filtering data needs to be cleared when with the other
asset library data of the file list. This is done when changing between
asset and file browser (and in other cases).
|
|
|
|
The search bar in the asset browser now also matches on asset tags.
- Matching is done on entire tags, so searching for "redder" will not
show assets tagged with "red".
- All assets are shown that have at least one matching tag. So searching
for "red green" will show all assets with either "red" or "green" tags
(or both, of course).
- Searching is case-insensitive.
- Only assets from the active catalog are shown; if all assets should be
searched through, users can select the "All" catalog.
Manifest Task: T82679
|
|
The asset browser search bar was filtering on the filename containing the
asset, and not the asset name. This is now fixed.
|
|
Perform a few cleanups:
- Add documentation to explain what returned bools mean.
- Early returns so that flow is clearer and some checks on `is_filtered`
are no longer necessary.
- Split up `is_filtered_file` and `is_filtered_id_file`, so that they can
reuse common code, and such that the different filter checks they
perform can be separated from each other.
The latter is done not only to reduce code duplication, but also as
preparation to fix the asset browser filtering. For that, it helps when
the "filter by file name" and "filter by file type" parts are separate.
No functional changes.
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D12991
|
|
If the current file is saved within an asset library, showing that asset
library in the Asset Browser will also display the assets from this current
file now. In fact, it's the latest state of the open file, including all
unsaved modifications.
These assets will show a little Blender icon in the preview image, which is our
usual icon for current file data.
Note that this means an important design change: The "Current File" asset
library isn't the only place to edit assets from anymore. From now on assets
from the current file can also be edited in the context of the full asset
library. See T90193 for more info.
Technical info:
Besides just including the assets from the current `Main`, this requires
partial clearing and reading of file-lists, so that asset operations (e.g.
removing an asset data-block) doesn't require a full reload of the asset
library.
Maniphest Task: https://developer.blender.org/T90193
|
|
|
|
Add `blender::bke::AssetLibraryService` class that acts like a
blendfile-scoped singleton. It's allocated upon the first call to
`BKE_asset_library_load` and destroyed in the LOAD-PRE handler.
The `AssetLibraryService` ensures that edits to asset catalogs are not
lost when the asset browser editor closes (or even reloads). Instead,
the `AssetLibrary` pointers it owns are kept around as long as the blend
file is open.
Reviewed By: Severin
Maniphest Tasks: T92151
Differential Revision: https://developer.blender.org/D12885
|
|
The asset catalog design was always that the active catalog would also
display all assets of its child catalogs (or grand-childs, etc.). This
is one of the main characteristics that differentiates catalogs from
usual directories.
Sybren prepared this on the asset catalog backend side with
56ce51d1f75a. This integrates it into the Asset Browser backend and the
UI.
|
|
file`
Introduced by fc7beac8d6f4. During code review it wasn't clear why this
branch was needed, so we removed it. Now it is clear why it is needed
so we added it back and added a comment why the branch is needed.
Patch provided by @Severin.
|
|
With this it is possible to select any number of assets in the Asset
Browser and drag them into catalogs. The assets will be moved to that
catalog then. However, this will only work in the "Current File" asset
library, since that is the only library that allows changing assets,
which is what's done here.
While dragging assets over the tree row, a tooltip is shown explaining
what's going to happen.
In preparation to this, the new UI tree-view API was already extended
with custom drop support, see 4ee2d9df428d.
----
Changes here to the `wmDrag` code were needed to support dragging multiple
assets. Some of it is considered temporary because a) a proper #AssetHandle
design should replace some ugly parts of this patch and b) the multi-item
support in `wmDrag` isn't that great yet. The entire API will have to be
written anyway (see D4071).
Maniphest Tasks: T91573
Differential Revision: https://developer.blender.org/D12713
Reviewed by: Sybren Stüvel
|
|
|
|
If the "Current File" asset library is selected in the Asset Browser,
now asssets are filtered based on the active asset catalog. Previously
it would just show all assets. This was marked as a TODO in the code
already.
Maniphest Task: https://developer.blender.org/T91820
|
|
The Asset Browser now displays a tree with asset catalogs in the left
sidebar.
This replaces the asset categories. It uses the new UI tree-view API
(https://wiki.blender.org/wiki/Source/Interface/Views#Tree-View).
Buttons are displayed for adding and removing of catalogs. Parent items
can be collapsed, but the collapsed/uncollapsed state is not stored in
files yet.
Note that edits to catalogs (e.g. new or removed catalogs) are only
written to the asset library's catalog definition files when saving a
.blend.
In the "Current File" asset library, we try to show asset catalogs from
a parent asset library, or if that fails, from the directory the file is
stored in. See adaf4f56e1ed.
There are plenty of TODOs and smaller glitches to be fixed still. Plus a
UI polishing pass should be done.
Important missing UI features:
* Dragging assets into catalogs (WIP, close to being ready).
* Renaming catalogs
* Proper handling of catalogs in the "Current File" asset library
(currently not working well).
The "Current File" asset library is especially limited still. Since this
is the only place where you can assign assets to a catalog, this makes
the catalogs very cumbersome in general. To assign an asset to a
catalog, one has to manually copy the Catalog ID (a random hash like
number) to the asset metadata through a temporary UI in the Asset
Browser Sidebar. These limitations should be addressed over the next few
days, they are high priority.
Differential Revision: https://developer.blender.org/D12670
|