Developer Forum

Adding a custom preview to an asset with python

I am working on automating the process of creating asset libraries with python. I can mark an asset with python by using:[‘my_object’].asset_mark()[‘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:


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


@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。