Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renderer): progressbar frame offset #1038

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions blenderproc/python/renderer/RendererUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ def _progress_bar_thread(pipe_out: int, stdout: IO, total_frames: int, num_sampl

# Continuously read blenders debug messages
current_line = ""
starting_frame_number = bpy.context.scene.frame_start
while True:
# Read the next character
char = os.read(pipe_out, 1)
Expand All @@ -573,10 +574,11 @@ def _progress_bar_thread(pipe_out: int, stdout: IO, total_frames: int, num_sampl
if char == "\n":
# Check if its a line we can use (starts with "Fra:")
if current_line.startswith("Fra:"):
# Extract current frame number and set to progress bar
# Extract current frame number and use it to set the progress bar
frame_number = int(current_line.split()[0][len("Fra:"):])
progress.update(complete_task, completed=frame_number)
progress.update(complete_task, status=f"Rendering frame {frame_number + 1} of {total_frames}")
frames_completed = frame_number - starting_frame_number
progress.update(complete_task, completed=frames_completed)
progress.update(complete_task, status=f"Rendering frame {frames_completed + 1} of {total_frames}")

# Split line into columns
status_columns = [col.strip() for col in current_line.split("|")]
Expand Down
Loading