featuredImg_BestRenderScript

BestRenderSequence script

As I was rendering my last animation, I thought it would be better if the renderer shot the most distant frames instead of the closest. In a sequence from 1 to 15, for instance, it wouldn’t render 1, 2, 3, 4… but 1, 15, 8, 4… always getting the middle frames.

I took it as a challenge with a friend, and finally got it working in python ::

# Best Render Sequence
# by Ed Schiffer
# www.edschiffer.com
 
def bestRenderSeq(inN, outN):
    inN, outN   = int(inN), int(outN)
    sortedSeq   = [inN, outN]
    finalSeq    = [inN, outN]
    tempList    = []
 
    while len(finalSeq) != (outN -inN +1):
        for item in sortedSeq:
            if sortedSeq.index(item) != 0:
                count = sortedSeq.index(item) 
                tempN = (sortedSeq[count] +sortedSeq[count -1]) /2
                tempList.append(tempN)
        for item in tempList:
            if item not in finalSeq:
                finalSeq.append(item)
                sortedSeq.append(item)
                sortedSeq.sort()
                tempList = []
    print "best render sequence: %s" %finalSeq
 
bestRenderSeq(10,30)

Comments

comments

Leave a Reply