ae_movie_export_aem.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. from tools import tools
  2. class MyTools(tools.Tools):
  3. def _initialize(self):
  4. self.add_argument_file('--in_path', 'in_path')
  5. self.add_argument_file('--out_path', 'out_path', exists=None)
  6. self.add_argument_dir('--export_path', 'export_path', exists=None)
  7. self.add_argument('--export_name', 'export_name')
  8. self.add_argument('--project_name', 'project_name')
  9. self.add_argument('--movie_name', 'movie_name')
  10. self.add_argument_bool('--use_sha1', 'use_sha1')
  11. pass
  12. def __compiler(self, args):
  13. command_path = self.get_tools_path("MovieCompiler.exe")
  14. if self.exist_file(command_path) is False:
  15. self.error_result("Not found MovieCompiler.exe")
  16. return False
  17. pass
  18. command_args = []
  19. in_path = args.in_path
  20. out_path = self.change_ext(args.out_path, "aez")
  21. command_args.extend(["--in_path", in_path])
  22. command_args.extend(["--out_path", out_path])
  23. if self.command_call("postbuild", command_path, command_args) is False:
  24. return False
  25. pass
  26. return True
  27. pass
  28. def __resource(self, args):
  29. command_path = self.get_tools_path("MovieResource.exe")
  30. if self.exist_file(command_path) is False:
  31. self.error_result("Not found MovieResource.exe")
  32. return False
  33. pass
  34. command_args = []
  35. in_path = args.in_path
  36. out_path = self.change_ext(args.out_path, "xml")
  37. command_args.extend(["--in_path", in_path])
  38. command_args.extend(["--out_path", out_path])
  39. command_args.extend(["--movie_name", args.movie_name])
  40. if self.command_call("postbuild", command_path, command_args) is False:
  41. return False
  42. pass
  43. return True
  44. pass
  45. def _run(self, args):
  46. if args.project_name == "None":
  47. self.copy_file(args.in_path, args.out_path)
  48. return True
  49. pass
  50. if self.__resource(args) is False:
  51. return False
  52. pass
  53. if self.__compiler(args) is False:
  54. return False
  55. pass
  56. return True
  57. pass
  58. pass
  59. tools.run(MyTools)