git @ Cat's Eye Technologies kinoje / 82c4fa6
Retain current usage for specifying output file. Chris Pressey 4 years ago
2 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3232
3333 You can also ask it to create a GIF by specifying an output filename with that as its file extension:
3434
35 bin/kinoje eg/squares.yaml -o squares.gif --duration=2.0
35 bin/kinoje eg/squares.yaml -o squares.gif
3636
3737 File Format
3838 -----------
1717 help='A YAML file containing the template to render for each frame, '
1818 'as well as configuration for rendering the template.'
1919 )
20 argparser.add_argument('output', metavar='FILENAME', type=str,
20 argparser.add_argument('-o', '--output', metavar='FILENAME', type=str, default=None,
2121 help='The movie file to create. The extension of this filename '
2222 'determines the output format and must be one of %r. '
2323 'If not given, a default name will be chosen based on the '
2727 options, unknown = argparser.parse_known_args(sys.argv[1:])
2828 remainder = ' '.join(unknown)
2929
30 if options.output is None:
31 (configbase, configext) = os.path.splitext(os.path.basename(options.configfile))
32 output_filename = configbase + '.mp4'
33 else:
34 output_filename = options.output
35
3036 exe = Executor()
3137
3238 instants_dir = mkdtemp()
3440
3541 exe.do_it("kinoje-expand {} {}".format(options.configfile, instants_dir))
3642 exe.do_it("kinoje-render {} {} {}".format(options.configfile, instants_dir, frames_dir))
37 exe.do_it("kinoje-compile {} {} {} {}".format(options.configfile, frames_dir, options.output, remainder))
43 exe.do_it("kinoje-compile {} {} {} {}".format(options.configfile, frames_dir, output_filename, remainder))
3844
3945 exe.close()