Blender Kitsu: Set Custom Thumbnail during Playblast #77

Merged
Nick Alberelli merged 12 commits from feature/custom-playblast-thumbnails into main 2023-06-15 21:26:54 +02:00
Showing only changes of commit b7c6af9c8b - Show all commits

View File

@ -896,19 +896,21 @@ def add_preview(
) )
def set_main_preview(preview_file, client=default): def set_main_preview(preview_file, frame_number, client=default):
""" """
Set given preview as thumbnail of given entity. Set given preview as thumbnail of given entity.
Args: Args:
preview_file (str / dict): The preview file dict or ID. preview_file (str / dict): The preview file dict or ID.
frame_number (int): Frame of preview video to set as main preview
Returns: Returns:
dict: Created preview file model. dict: Created preview file model.
""" """
data = {"frame_number": frame_number} if frame_number > 1 else {}
preview_file = normalize_model_parameter(preview_file) preview_file = normalize_model_parameter(preview_file)
path = "actions/preview-files/%s/set-main-preview" % preview_file["id"] path = "actions/preview-files/%s/set-main-preview" % preview_file["id"]
return raw.put(path, {}, client=client) return raw.put(path, data, client=client)
@cache @cache