Blender Kitsu: Set Custom Thumbnail during Playblast #77
@ -1,11 +1,6 @@
|
|||||||
import string
|
import string
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from blender_kitsu.gazu.exception import (
|
|
||||||
TaskStatusNotFoundException,
|
|
||||||
TaskMustBeADictException,
|
|
||||||
)
|
|
||||||
|
|
||||||
from . import client as raw
|
from . import client as raw
|
||||||
from .sorting import sort_by_name
|
from .sorting import sort_by_name
|
||||||
from .helpers import (
|
from .helpers import (
|
||||||
@ -882,19 +877,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
|
||||||
|
Loading…
Reference in New Issue
Block a user