BLENDER GIF preview in bpy.types.Panel

48 Views Asked by At

I would like to present animated GIF in blender UILayout. This gif is intended to suggest how the operator (button) works, something like tooltip. Can be showed as popup window or animation in UI Panel. I found function template_movieclip for displaying moveclip in Panel. I think it might be helpful, but I don't know how use this function. I didn't found any example.

Is there anyone here who could write an example code snippet to use this function?

Docs: template_movieclip(data, property, compact=False) https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.template_movieclip

For displaying static image I has simple code like:

# at top of file
p_coll = bpy.utils.previews.new()
p_coll.load('test', os.path.join(HERE, 'icons', 'test.png'), 'IMAGE', force_reload=True)
# in draw function
tex = p_coll['test']
row.template_icon(icon_value=tex.icon_id, scale=10)

The above code works fine.

0

There are 0 best solutions below