Hack to fix randomly appended fragments

This breaks a more rarely used feature, and needs a proper fix
This commit is contained in:
Daniel Molkentin 2019-09-12 13:27:20 +02:00
parent 32b1cd8885
commit bb6a9a432b

View file

@ -125,10 +125,12 @@ def cachedRenderFrame(frame, frameNr, task, cache):
elif not skip_rendering: elif not skip_rendering:
cache[frame] = frameNr cache[frame] = frameNr
with SVGTemplate(task) as svg: svgfile = '{0}/.frames/{1:04d}.svg'.format(task.workdir, frameNr)
with SVGTemplate(task, svgfile) as svg:
svg.replacetext() svg.replacetext()
svg.transform(frame) svg.transform(frame)
svgfile = svg.write() svg.write()
outfile = '{0}/.frames/{1:04d}.png'.format(task.workdir, frameNr) outfile = '{0}/.frames/{1:04d}.png'.format(task.workdir, frameNr)
renderFrame(svgfile, task, outfile) renderFrame(svgfile, task, outfile)
@ -200,9 +202,12 @@ def rendertask(task):
if debug: if debug:
print("generating {0} from {1}".format(task.outfile, task.infile)) print("generating {0} from {1}".format(task.outfile, task.infile))
if args.skip_frames and 'only_rerender_frames_after' not in task.parameters: ## Hacky workaround: Fix this properly without breaking the
if os.path.isdir(os.path.join(task.workdir, '.frames')): ## support for partially rendered intros
shutil.rmtree(os.path.join(task.workdir, '.frames')) if True: #args.skip_frames and 'only_rerender_frames_after' not in task.parameters:
if os.path.isdir(os.path.join(task.workdir, '.frames')):
print("Removing", os.path.join(task.workdir, '.frames'))
shutil.rmtree(os.path.join(task.workdir, '.frames'))
# make sure a .frames-directory exists in out workdir # make sure a .frames-directory exists in out workdir
ensurePathExists(os.path.join(task.workdir, '.frames')) ensurePathExists(os.path.join(task.workdir, '.frames'))