AWS Thinkbox Discussion Forums

Cookbook Proposal: SeqRange

[code]import re
import glob

#examplepath = r"C:\DeleteMe2\A01.04\DeleteME2_A01.04.####.exr"
hashRE = re.compile(r’(#+)’)

def imgSeqRange (filePath):
match = hashRE.search(filePath)
if match is None:
return
start, end = match.span()
frameList = glob.glob(filePath.replace("#","[0-9]"))
if not frameList:
return
frameNums = [int(f[start:end]) for f in frameList]
return (min(frameNums), max(frameNums))[/code]

Thanks! I think we’d like to add something like this directly to Draft too.

Privacy | Site terms | Cookie preferences