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
2021-07-21Cleanup: Move reorganize asset filesJulian Eisel
I'm trying to move away from general files with lots of things in them, and instead have many small & focused files. I find that easier to work with since everything has clear responsibilities, even if there is some minor overhead in managing all these files. I also try to differentiate more clearly between public and internal files. So source files and internal headers are in a `intern/` sub-directory, public functions are in a number of headers one level higher. For convenience and to make this compatible with our existing general headers in `editors/include`, I made the `ED_asset.h` there include all these public headers. This is of course a bit of an experiment, let's see how it works in practice. Also corrected the name of `ED_asset_can_make_single_from_context()`.
2021-07-21Cleanup: Centralize/unify asset library reference from/to enum codeJulian Eisel
This was an open TODO, I wanted to have code for translating asset library references from and to enum values in a central place, and access that in the same way from both the Asset Browser and the Workspace RNA code. * Adds own file for the related functions. * Adds doxygen comments. * Updates RNA callbacks to properly use these functions. * Let these functions call each other, avoid duplicating logic.
2021-07-20Cleanup: Move asset-handle functions to own fileJulian Eisel
Keeps files minimal and focused. I much prefer that over having all kinds of stuff in general files like `asset_edit.cc`.
2021-07-20Cleanup: Getters for asset-handle dataJulian Eisel
While the asset-handle design is supposed to be temporary (see 35affaa971cf), I prefer keeping the fact that it's nothing but a file entry pointer an implementation detail that is abstracted away. So this introduces getters for the file data we typically access for asset-handles.
2021-07-16Cleanup: spelling in commentsCampbell Barton
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-02-10Cleanup: remove redundant headers in source/blender/editors/Campbell Barton
Remove redundant headers using `./source/tools/utils_maintenance/code_clean.py` Reviewed By: jmonteath Ref D10364
2021-02-06Code quality: Port recently added asset files to C++Julian Eisel
It seems generally preferred to have new files be created with C++. The only reason I didn't do that when I initially created the files is that I was unsure about some C-API aspect. Also includes some minor C++ related cleanup (nullptr instead of NULL, remove redundant `struct` keyword).