92 |
scalePostfix = '' |
scalePostfix = '' |
93 |
if scale != 1: scalePostfix = '-%sx' % (scale) |
if scale != 1: scalePostfix = '-%sx' % (scale) |
94 |
|
|
|
w.setLocation(0,0,384*scale,384*scale) |
|
95 |
size = vs.getSize() |
size = vs.getSize() |
96 |
|
|
97 |
# for Java to accept Python Long |
# for Java to accept Python Long |
109 |
|
|
110 |
if (jpeg): |
if (jpeg): |
111 |
print 'Saving background texture into %s%s-paper.gen.jpg.' % (str(seed), scalePostfix) |
print 'Saving background texture into %s%s-paper.gen.jpg.' % (str(seed), scalePostfix) |
112 |
saveanim.saveframe('bgfile.tmp', w, 0, 0, 384*scale, 384*scale) |
saveanim.saveframe('bgfile.tmp', w, 0, 0, 384, 384) |
113 |
os.system("convert -quality 95 %s %s" \ |
os.system("convert -quality 95 %s %s" \ |
114 |
% ('bgfile.tmp', basedir+str(seed)+'%s-paper.gen.jpg' % (scalePostfix))) |
% ('bgfile.tmp', basedir+str(seed)+'%s-paper.gen.jpg' % (scalePostfix))) |
115 |
os.system("rm bgfile.tmp") |
os.system("rm bgfile.tmp") |
|
w.setLocation(0,0,384,384) |
|
116 |
return os.path.abspath(basedir+str(seed)+'%s-paper.gen.jpg' % (scalePostfix)) |
return os.path.abspath(basedir+str(seed)+'%s-paper.gen.jpg' % (scalePostfix)) |
117 |
else: |
else: |
118 |
print 'Saving background texture into %s%s-paper.gen.png.' % (str(seed), scalePostfix) |
print 'Saving background texture into %s%s-paper.gen.png.' % (str(seed), scalePostfix) |
119 |
saveanim.saveframe(basedir+str(seed)+'%s-paper.gen.png' % (scalePostfix), |
saveanim.saveframe(basedir+str(seed)+'%s-paper.gen.png' % (scalePostfix), |
120 |
w, 0, 0, 384*scale, 384*scale) |
w, 0, 0, 384, 384) |
|
w.setLocation(0,0,384,384) |
|
121 |
return os.path.abspath(basedir+str(seed)+'%s-paper.gen.png' % (scalePostfix)) |
return os.path.abspath(basedir+str(seed)+'%s-paper.gen.png' % (scalePostfix)) |
122 |
|
|
123 |
class Main(Runnable): |
class Main(Runnable): |
126 |
from vob.paper.papermill import ThePaperMill |
from vob.paper.papermill import ThePaperMill |
127 |
|
|
128 |
w = gfxapi.createWindow() |
w = gfxapi.createWindow() |
129 |
|
w.setLocation(0,0,384,384) |
130 |
vs = w.createVobScene() |
vs = w.createVobScene() |
131 |
print "Working directory:", basedir |
print "Working directory:", basedir |
132 |
|
|