__author__ = 'thoth'
from os.path import isfile
def next_file_name(pattern):
i=1
if (pattern%1) == (pattern %2):
raise Exception("bad file name pattern")
while isfile(pattern%i):
i=i+1
return pattern%i
print ( next_file_name("/var/tmp/blender/voronoi-wave/%04d.png") )
|
Blender python API quick-start
Syntax highlighting by Pygments.