Blender Git Commit Log

Git Commits -> Revision 35affaa

Revision 35affaa by Julian Eisel (master)
July 15, 2021, 14:12 (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`.

Commit Details:

Full Hash: 35affaa971cfb2d1829031f49a6ef9fb19ca576f
Parent Commit: 3feb3ce
Committed By: Sybren A. Stüvel
Lines Changed: +109, -0

8 Modified Paths:

/source/blender/blenkernel/BKE_context.h (+4, -0) (Diff)
/source/blender/blenkernel/intern/context.c (+25, -0) (Diff)
/source/blender/editors/asset/asset_edit.cc (+7, -0) (Diff)
/source/blender/editors/include/ED_asset.h (+2, -0) (Diff)
/source/blender/makesdna/DNA_asset_types.h (+11, -0) (Diff)
/source/blender/makesrna/intern/rna_asset.c (+32, -0) (Diff)
/source/blender/makesrna/intern/rna_context.c (+27, -0) (Diff)
/source/blender/makesrna/RNA_access.h (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021