()
| 62 | |
| 63 | # python3 convert.py path_to_ply --level [0, 1, 2, ...] |
| 64 | def main(): |
| 65 | parser = argparse.ArgumentParser(description="Convert PLY files to SPLAT format.") |
| 66 | parser.add_argument( |
| 67 | "input_files", nargs="+", help="The input PLY files to process." |
| 68 | ) |
| 69 | parser.add_argument( |
| 70 | "--output", "-o", default="output.splat", help="The output SPLAT file." |
| 71 | ) |
| 72 | parser.add_argument( |
| 73 | "--level", "-l", default=0, help="The level of detail. [0, 1, 2, ...]" |
| 74 | ) |
| 75 | args = parser.parse_args() |
| 76 | for input_file in args.input_files: |
| 77 | print(f"Processing {input_file}...") |
| 78 | splat_data = process_ply_to_splat(input_file, args.level) |
| 79 | output_file = ( |
| 80 | args.output if len(args.input_files) == 1 else input_file + ".splat" |
| 81 | ) |
| 82 | save_splat_file(splat_data, output_file) |
| 83 | print(f"Saved {output_file}") |
| 84 | |
| 85 | |
| 86 | if __name__ == "__main__": |
no test coverage detected