AWS Thinkbox Discussion Forums

Create qt + thumbnail

Let’s say that i have 100 frames, that are defined in the Draft template.
Could someone post an example how i could select the 50th of the sequence?
I’m asking because i want to make this automatically (to work even if i have 200 frames in sequence, even if i have 10 frames in sequence).
i’ve tried to define the thumb_frame as :

thumb_l = len(frames) thumb = round(thumb_l/2)
but seems like that doesn’t work.
I’m probably missing something here… and i know for sure that somebody else already did that :wink:

Can you post your errors? Hard to tell exactly what’s wrong.
Are you just using the number and not the file name? Something like encoding frame 50 isn’t going to work. You’d have to encode rendered_image.050.exr as an example.

Assuming you got the list of frames using something like:

frames = FrameRangeToFrames( frameRange )

Then you could get the frame using:

frameNumber = frames[ round( len( frames ) / 2 ) ] swappedFileName = ReplaceFilenameHashesWithNumber( inFilePattern, frameNumber ) frameImage = Draft.Image.ReadFromFile( swappedFileName )

Thank you, so i could put this before making the qt… testing now :wink:

Update:

0: STDOUT: frameNumber = frames[ round( len( frames ) / 2 ) ]
0: STDOUT: TypeError: list indices must be integers, not float

Second update:

Managed to fix it… as python 2x alteady floors the division… :wink: so i don’t really need round :wink:

My apologies for not testing the code first. I’m glad it’s working for you!

Privacy | Site terms | Cookie preferences