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-11-09Asset System: New core type to represent assets (`AssetRepresenation`)Julian Eisel
Introduces a new `AssetRepresentation` type, as a runtime only container to hold asset information. It is supposed to become _the_ main way to represent and refer to assets in the asset system, see T87235. It can store things like the asset name, asset traits, preview and other asset metadata. Technical documentation: https://wiki.blender.org/wiki/Source/Architecture/Asset_System/Back_End#Asset_Representation. By introducing a proper asset representation type, we do an important step away from the previous, non-optimal representation of assets as files in the file browser backend, and towards the asset system as backend. It should replace the temporary & hacky `AssetHandle` design in the near future. Note that the loading of asset data still happens through the file browser backend, check the linked to Wiki page for more information on that. As a side-effect, asset metadata isn't stored in file browser file entries when browsing with link/append anymore. Don't think this was ever used, but scripts may have accessed this. Can be brought back if there's a need for it.
2022-07-28Cleanup: Fix typo in commentJulian Eisel
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
2021-10-25Assets: Snapping with visual feedback while draggingGermano Cavalcante
The drag and drop feature of objects in 3D View has been modified to include: - Snap the object being dragged. - Visual feedback through a box and the placement tool grid. Maniphest Tasks: T90198 Differential Revision: https://developer.blender.org/D12912
2021-10-25Assets: Add Author field to asset metadataJulian Eisel
This is information you'd typically want to be visible in the UI. It's optional of course, so if not relevant, it can just remain unset.
2021-09-23Assets: add Asset Catalog systemSybren A. Stüvel
Catalogs work like directories on disk (without hard-/symlinks), in that an asset is only contained in one catalog. See T90066 for design considerations. #### Known Limitations Only a single catalog definition file (CDF), is supported, at `${ASSET_LIBRARY_ROOT}/blender_assets.cats.txt`. In the future this is to be expanded to support arbitrary CDFs (like one per blend file, one per subdirectory, etc.). The current implementation is based on the asset browser, which in practice means that the asset browser owns the `AssetCatalogService` instance for the selected asset library. In the future these instances will be accessible via a less UI-bound asset system. The UI is still very rudimentary, only showing the catalog ID for the currently selected asset. Most notably, the loaded catalogs are not shown yet. The UI is being implemented and will be merged soon. #### Catalog Identifiers Catalogs are internally identified by UUID. In older designs this was a human-readable name, which has the problem that it has to be kept in sync with its semantics (so when renaming a catalog from X to Y, the UUID can be kept the same). Since UUIDs don't communicate any human-readable information, the mapping from catalog UUID to its path (stored in the Catalog Definition File, CDF) is critical for understanding which asset is stored in which human-readable catalog. To make this less critical, and to allow manual data reconstruction after a CDF is lost/corrupted, each catalog also has a "simple name" that's stored along with the UUID. This is also stored on each asset, next to the catalog UUID. #### Writing to Disk Before saving asset catalogs to disk, the to-be-overwritten file gets inspected. Any new catalogs that are found thre are loaded to memory before writing the catalogs back to disk: - Changed catalog path: in-memory data wins - Catalogs deleted on disk: they are recreated based on in-memory data - Catalogs deleted in memory: deleted on disk as well - New catalogs on disk: are loaded and thus survive the overwriting #### Tree Design This implements the initial tree structure to load catalogs into. See T90608, and the basic design in T90066. Reviewed By: Severin Maniphest Tasks: T91552 Differential Revision: https://developer.blender.org/D12589
2021-08-06Cleanup: rename `FileList::asset_library` → `asset_library_ref`Sybren A. Stüvel
In the `FileList` struct, rename the `AssetLibraryReference *asset_library` field to `asset_library_ref` -- it's a description of which asset library is used, and not the asset library itself. This is to make space for a future `AssetLibrary *asset_library` field, which will point to an actual asset library struct/class. No functional changes. Reviewed by: Severin Differential Revision: https://developer.blender.org/D12151
2021-07-29Assets/UI: Resolve major asset view UI template limitationJulian Eisel
Before this, all asset view templates showing the same asset library would show the same assets, even if they should show different ID types. That was a major limitation since the design did forsee that this template can be put anywhere in the UI to display various sub-sets of assets. Initially I did the ID type filtering close to the asset-list reading, because I wanted to optimize reading so that we would only actually read asset information from disk of the ID type to be shown. But this will be quite complex and I'm not sure if I'll get to work on this anytime soon. So this commit moves the filtering to the template display level solving this limitation. Note: This also adds the code to filter by tags, together with the ID type. But it's not actually used anywhere yet.
2021-07-21Assets: Replace duplicated asset library reference type from DNAJulian Eisel
Since recently it's possible to access assets from outside the File/Asset Browser, via the asset view template. So we are slowly moving away from file space specific code to dedicated asset system code. I introduced `AssetLibraryReference` as a duplicate of `FileSelectAssetLibraryUID`, with a plan to delete the latter in a separate cleanup commit. That's exactly what this commit is. This will cause Asset Browsers to open with the default "Current File" Asset Library. We could avoid that, but it's a minor issue really.
2021-07-20Cleanup: Use const for internal file data of asset-handleJulian Eisel
Note that the current asset-handle design is temporary, see 35affaa971cf. I still prefer this to be const, as code outside the asset-list/file-list code should never mess with the file data of an asset.
2021-07-15Assets: Initial Asset List as part of the Asset System designJulian Eisel
Implements a basic, WIP version of the asset list. This is needed to give the asset view UI template asset reading and displaying functionality. See: * Asset System: Data Storage, Reading & UI Access - https://developer.blender.org/T88184 Especially the asset list internals should change. It uses the File/Asset Browser's `FileList` API, which isn't really meant for access from outside the File Browser. But as explained in T88184, it does a lot of the stuff we currently need, so we (Sybren Stüvel and I) decided to go this route for now. Work on a file-list rewrite which integrates well with the asset system started in the `asset-system-filelist` branch. Further includes: * Operator to reload the asset list. * New `bpy.types.AssetHandle.get_full_library_path()` function, which gets the full path of the asset via the asset-list. * Changes to preview loading to prevent the preview loading job to run eternally for asset views. File Browsers have this issue too, but should be fixed separately.
2021-07-15Assets: AssetHandle type as temporary design to reference assetsJulian Eisel
With temporary I mean that this is not intended to be part of the eventual asset system design. For that we are planning to have an `AssetRepresentation` instead, see T87235. Once the `AssetList` is implemented (see T88184), that would be the owner of the asset representations. However for the upcoming asset system, asset browser, asset view and pose library commits we need some kind of asset handle to pass around. That is what this commit introduces. Idea is a handle to wrap the `FileDirEntry` representing the asset, and an API to access its data (currently very small, will be extended in further commits). So the fact that an asset is currently a file internally is abstracted away. However: We have to expose it as file in the Python API, because we can't return the asset-handle directly there, for reasons explained in the code. So the active asset file is exposed as `bpy.context.asset_file_handle`.
2021-07-15Assets: Add an active asset library per workspace, for the UI to useJulian Eisel
This per-workspace active asset library will be used by the asset views later. Note that Asset Browsers have their own active asset library, overriding the one from the workspace. As part of this the `FileSelectAssetLibraryUID` type gets replaced by `AssetLibraryReference` which is on the asset level now, not the File/Asset Browser level. But some more work is needed to complete that, which is better done in a separate commit. This also moves the asset library from/to enum-value logic from RNA to the editor asset level, which will later be used by the asset view.
2021-01-04Cleanup: use 'pragma once'Campbell Barton
Add explanations for cases the header-guard defines are still used.
2020-12-15Asset System: Data-block asset metadata storage, reading and APIJulian Eisel
Asset metadata is what turns a regular data-block into an asset. It is a small data-structure, but a key part of the technical design of the asset system. The design foresees that asset data-blocks store an `ID.asset_data` pointer of type `AssetMetaData`. This data **must not** have dependencies on other data-blocks or data-block data, it must be an independent unit. That way we can read asset-metadata from .blends without reading anything else from the file. The Asset Browser will use this metadata (together with the data-block name, preview and file path) to represent assets in the file list. Includes: * New `ID.asset_data` for asset metadata. * Asset tags, description and custom properties. * BKE code to manage asset meta-data and asset tags. * Code to read asset data from files, without reading IDs. * RNA for asset metadata (including tags) Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9716 Reviewed by: Bastien Montagne, Brecht Van Lommel