import sys import ae_script import logging l = os.path.abspath(__file__) t = os.path.split(l)[0] loc = t + "/../" loc = os.path.normpath(loc) if loc not in sys.path: print loc sys.path.append(loc) if __name__ == "__main__": import argparse out = ae_script.Out("preview.out") parser = argparse.ArgumentParser() parser.add_argument("--project_path") parser.add_argument("--composition_name") parser.add_argument("--work_area") args = parser.parse_known_args()[0] project = os.path.split(args.project_path)[0] os.chdir("..\\examples\\HelloViewerAE\\data\\") cmd = "HelloViewerAE.exe \"{}\" \"{}\" \"{}\"> viewer.log".format( project, args.composition_name, args.work_area) out.log.write("runing AEViewer...\n")
self.fp = fp self.sechead = '[asection]\n' def readline(self): if self.sechead: try: return self.sechead finally: self.sechead = None else: return self.fp.readline() if __name__ == "__main__": out = ae_script.Out("settings.out") import argparse parser = argparse.ArgumentParser() parser.add_argument("--project_path") def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Boolean value expected.') parser.add_argument("--preview", type=str2bool)
import sys import os import shutil import ae_script import argparse if __name__ == "__main__": out = ae_script.Out("prebuild.out") parser = argparse.ArgumentParser() parser.add_argument("aem") parser.add_argument("--movie_folder") args = parser.parse_known_args()[0] try: shutil.rmtree(args.movie_folder) except OSError: pass os.makedirs(args.movie_folder) out.close()
import sys import os import ae_script if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument("--cfg_path") args = parser.parse_known_args()[0] out = ae_script.Out("multiexport.out") dest = "" def eprint(arg): out.write(arg) eprint("[settings]") out.write_settings() eprint("[data]") def go(path): items = os.listdir(path) for item in items: folder = os.path.join(path, item) if os.path.isdir(folder): v = folder r = os.path.split(v)[1]
name = quoteattr(name) write("\t\t<image file=%s/>\n" % (name)) write("\t</atlas>\n") write("</resources>\n") dest.close() import os import argparse parser = argparse.ArgumentParser() parser.add_argument("aem") parser.add_argument("--movie_folder") args = parser.parse_known_args()[0] out = ae_script.Out("postbuild.out") dest = args.movie_folder try: os.makedirs(dest + "/images") except OSError: pass gen_xml( dest, dest + "/res.xml", ) out.close()