I am working on automating the process of creating asset libraries with python. I can mark an asset with python by using:
bpy.data.objects[‘my_object’].asset_mark()
bpy.data.objects[‘my_object’].asset_generate_preview()
but in some instances I want to load a custom preview. The only way I know how to add a custom preview is by using:
bpy.ops.ed.lib_id_load_custom_preview()
As far as I know this can only be called from the interface and not python. Does anyone know how to load a custom preview for an asset with python?
This question just came up again. I added a new asset system FAQ Wiki page which covers this: Source/Architecture/Asset System/FAQ - Blender Developer Wiki
2 Likes
@julianeisel Will this work with Movie and Sound IDs?
@julianeisel ^ Would it be possible for you to enable previews for Movie and Sound data-blocks, without too much trouble? So, they at least can have custom thumbnails or thumbnails added via a script(using ffmpeg rendering thumb or waveform)?
The ID of the blender’s collection asset cannot be recognized, and the user-defined thumbnail cannot be loaded. But the collection instance is OK,Because it’s an object.I don’t know how to solve it。
