Blender Git Loki

Blender Git "temp-asset-browser-poselib-merge" branch commits.

Page: 2 / 2

July 14, 2021, 15:02 (GMT)
File/Asset Browser: Extend file-entry and asset handle Python API

Adds the following to `bpy.types.FileSelectEntry`:
* `id_type`: The data-block type the file represenets, if any.
* `local_id`: The local data-block it represents, if any (assets only).

And the following to `bpy.types.AssetHandle`:
* `local_id`: The local data-block the asset represents, if any.

This kind of information and the references are important for asset related
operators and UIs. They will be used by upcoming Pose Library features.
July 14, 2021, 15:02 (GMT)
Animation/add-ons: Enable the poselib add-on by default

The new Asset Browser-based pose library is partially implemented in an
add-on. This commit enables the add-on by default, as the old pose
library was built-in and thus always enabled.

The ability to disable the add-on is there mostly for cases where
people/studios want to use their own custom pose library.
July 14, 2021, 15:02 (GMT)
Assets: AssetHandle type as temporary design to reference assets

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`.
July 14, 2021, 15:02 (GMT)
Assets: Initial Asset List as part of the Asset System design

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.
July 14, 2021, 15:02 (GMT)
Assets: Show asset path in asset browser sidebar

It's useful to know where an asset is stored in, before this there was no way
to tell this. This could probably be displayed nicer in the UI but we're
currently unsure how. But at least the information is there now.
July 14, 2021, 15:02 (GMT)
Assets: Abstraction for temporary loading of asset data-blocks

This is an editor-level abstraction for the `BLO_library_temp_xxx()`
API for temporary loading of data-blocks from another Blend file. It
abstracts away the asset specific code, like asset file-path handling
and local asset data-block handling.

Main use-case for this is applying assets as presets that are based on
data-blocks, like poses. Such preset assets are an important part of the
asset system design, so such an abstraction will likely find more usage
in the future.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021