Skip to content

Commit

Permalink
Correctly set output directory in render_state.py
Browse files Browse the repository at this point in the history
  • Loading branch information
unkaktus committed Mar 6, 2023
1 parent 229963c commit 9f62569
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions render/render_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
parser.add_argument("--total-task-number", type=int, help="Total number of tasks")
parser.add_argument("--task-id", type=int, help="Current task ID")
parser.add_argument("--state", type=str, help="State filename")
parser.add_argument("--output-dir", type=str, help="Path to output directory", default="")
parser.add_argument("--output-dir", type=str, help="Path to output directory", default=None)
args = parser.parse_args()


output_dir = os.path.splitext(args.state)[0]
if output_dir != "":
if args.output_dir is not None:
output_dir = args.output_dir

# Create output directory if it doesn't exist
Expand Down Expand Up @@ -52,7 +52,7 @@
animation.AnimationTime = frame_time
pv.Render()
filename = f'frame.{global_frame_id:06d}.png'
filepath = os.path.join(args.output_dir, filename)
filepath = os.path.join(output_dir, filename)
pv.SaveScreenshot(filepath)

print(f'[{args.task_id}] Done')

0 comments on commit 9f62569

Please sign in to comment.