Thumbnail Grid View for Add-on Developers
Summary
Add a new UILayout template method to display thumbnail grids on panels with operator_drop_id and operator_activate_id replacing functionality lost when template_asset_view was removed in Blender 5.0.
API Example
template_thumbnail_view(path,index,activate_operator_id="",drag_operator_id="")
- path (string never None)- This is the path to get thumbnails from. This could be a directory, or a blend file that contains marked assets with thumbnails.
- index (int) - Property that determines the current index of what is selected. Maybe this would need to be two arguments. The data to get the index from, and the name of the index property. Similar to how template_lists work.
- activate_operator_id (string) - bl_id of the operator to run when a thumbnail is selected.
- drag_operator_id (string) - bl_id of the operator to run when a thumbnail is dragged.
The activate and drag operator would need a property defined that would tell the operator the name of the thumbnail that was selected or dragged.
Video Example
This is a video that shows how I was using the template_asset_view to organize the assets in my add-on.
0 Comments