Skip to content

setPosterFrame

setPosterFrame(posterFrame=0.5)

Update the poster frame of the given clipItmes posterFrame = .5 uses the centre frame, a value of 0 uses the first frame, a value of 1 uses the last frame

Source code in client/ayon_hiero/api/startup/Python/StartupUI/setPosterFrame.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def setPosterFrame(posterFrame=.5):
    """
    Update the poster frame of the given clipItmes
    posterFrame = .5 uses the centre frame, a value of 0 uses the first frame, a value of 1 uses the last frame
    """
    view = hiero.ui.activeView()

    selectedBinItems = view.selection()
    selectedClipItems = [(item.activeItem()
                          if hasattr(item, "activeItem") else item)
                         for item in selectedBinItems]

    for clip in selectedClipItems:
        centreFrame = int(clip.duration() * posterFrame)
        clip.setPosterFrame(centreFrame)