Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-21Refactor: Move file browser filelist.c to C++Julian Eisel
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.
2022-06-27Fix T98055: Library Filters do not work in Source FilesSonny Campbell
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
2022-06-06STL: Add new C++ based STL importerIyad Ahmed
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
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell Barton
2022-05-07Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtlJulian Eisel
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
2022-04-14Cleanup: Further hair to curves renamingHans Goudey
These were missed in previous passes. Also remove some logic in `draw_hair.c` that was redundant after f31c3f8114616bb8964c8e7.
2022-04-05Cleanup: use doxygen links to struct membersCampbell Barton
2022-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.
2022-03-19Fix T95257: Filter files on "name" and "relpath"Harley Acheson
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
2022-03-11Fix T94692: Show Cached OneDrive ThumbnailsHarley Acheson
When OneDrive files are offline, show preexisting thumbnails. See D13930 for details. Differential Revision: https://developer.blender.org/D13930 Reviewed by Julian Eisel
2022-03-09Cleanup: use ELEM macroCampbell Barton
2022-03-01Cleanup: use doxygen comments, correct spellingCampbell Barton
Also move eDupli_ID_Flags doc-string to it's declaration.
2022-02-11File headers: SPDX License migrationCampbell Barton
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
2022-02-08BLF: Enable Filtering of woff and woff2 FontsHarley Acheson
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
2022-01-31Cleanup: use our own conventions for tags in commentsCampbell Barton
2022-01-20Fix file/asset thumbnails causing constant stream of notifiersJulian Eisel
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.
2022-01-19Fix: File Browser using asset indexer after Asset Browser was visibleJulian Eisel
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.
2022-01-14Cleanup: spelling in comments, C++ style comments for disabled codeCampbell Barton
Also ensure space at end of comment.
2021-12-14Cleanup: consistent naming for the blender file nameCampbell Barton
2021-12-09Fix T93691: Crash when loading custom thumbnail in custom libraryJulian Eisel
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).
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-07Fix memory leak when loading large asset librariesJulian Eisel
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
2021-11-24UI: Blend File Icons Thumbnail ViewHarley Acheson
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
2021-11-24T91406: Asset Library IndexingJeroen Bakker
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
2021-11-24Cleanup: unused variableGermano Cavalcante
2021-11-24Fix (unreported): Local preview icons not loadingGermano Cavalcante
Bug introduced in {rB9d7422b817d1}. The solution is not an init thread for preview tasks that won't complete.
2021-11-20Cleanup: unset 'FILE_ENTRY_PREVIEW_LOADING' at the endGermano Cavalcante
Although this function only runs on the main thread, it seems safer to clear the flag only after setting the result.
2021-11-19Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-19Asset Browser: don't display linked-in asset datablocksSybren A. Stüvel
Datablocks marked as asset, linked from another file, were shown in the "Current File" asset library. This is now resolved.
2021-11-18Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-18Asset tags: include partial tag matchesSybren A. Stüvel
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.
2021-11-16File Browser: Improve usage of threads in the creation of thumbnailsGermano Cavalcante
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
2021-11-12Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-12Fix crash in asset browser when switching from file browserSybren A. Stüvel
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.
2021-10-29Fix T92576: Crash switching from Asset Browser to File BrowerJulian Eisel
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).
2021-10-26Cleanup: spelling in commentsCampbell Barton
2021-10-25Asset Browser: apply search filter to tags as wellSybren A. Stüvel
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
2021-10-25Fix T87627: Asset Browser Search Bar not workingSybren A. Stüvel
The asset browser search bar was filtering on the filename containing the asset, and not the asset name. This is now fixed.
2021-10-25Cleanup: refactor filelist filter functionsSybren A. Stüvel
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
2021-10-20Asset Browser: Show current file assets in other asset libraries if containedJulian Eisel
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
2021-10-20Cleanup: Remove unused file-list array info membersJulian Eisel
2021-10-18Assets: add global `bke::AssetLibraryService` classSybren A. Stüvel
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
2021-10-04Assets: Show all assets indirectly nested inside the active catalogJulian Eisel
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.
2021-10-04Fix T91823: Regression not showing idblocks when recursion is set to `Blend ↵Julian Eisel
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.
2021-10-04Asset Browser: Support dragging assets into catalogsJulian Eisel
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
2021-10-04Cleanup: Rename file-list function to better match what it's doingJulian Eisel
2021-09-30Asset Browser: Support activating catalogs in the "Current File" libraryJulian Eisel
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
2021-09-29Asset Browser: Initial Asset Catalog UIJulian Eisel
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