Page MenuHome

Grease pencil frames not rendered in background mode
Closed, ResolvedPublic

Description

System Information
Operating system: Kubuntu 20.04, Windows 10
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.102.04

Blender Version
Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: rB5be9ef417703
Broken: version: 2.93.0 Alpha, branch: master (modified), commit date: 2021-01-25 09:32, hash: rB5f55022276a8
Worked: version: 2.83.9, branch: master, commit date: 2020-11-11 06:30, hash: rB4abfc0bcd5c8

Short description of error
In a very specific configuration, some grease pencil frames are only rendered in graphical mode, but not in background mode. It apparently involves saving the file with the current frame before the first animation frame.

Exact steps for others to reproduce the error

  • Open the attached file, and press CTRL + F12 to render the animation
    • In the resulting file, all frames are correctly rendered
  • Render the same file in the background by using the following command: blender --factory-startup -b grease_pencil_render_bug.blend -a
    • Keyframe 103 is skipped, and keyframe 105 appears only at frame 106.

OR

  • Create new 2D animation file
  • Set first frame to 101, last frame to 110
  • Draw something at frames 101, 103, 105, 107, 110
  • Delete existing frame 1
  • Set the current frame to before the first frame (e.g. 60)
  • Save file
  • Press CTRL + F12 to render the animation
    • In the resulting file, all frames are correctly rendered
  • Render the same file in the background by using the following command: blender --factory-startup -b grease_pencil_render_bug.blend -a
    • Frames 103-105 are skipped.

Here are the resulting animations
Rendered in the foreground, expected:

Rendered in the background, frames 103-105 skipped:

Event Timeline

Falk David (filedescriptor) changed the task status from Needs Triage to Confirmed.Jan 25 2021, 3:46 PM

I can reproduce this on 2.92.0 Beta, branch: master, commit date: 2021-01-25 06:40, hash: rB7f9ed0178ade. If the file is saved with the play-head inside the start and end frame it renders as expected in background mode. But when I save the file with the play-head before the start frame, the first 5 images are all the same.

For anyone encountering this bug, a workaround is to set the current frame to the first frame prior to rendering:

blender -b grease_pencil_render_bug.blend --python-expr "import bpy \
bpy.context.scene.frame_set(bpy.context.scene.frame_start)" -a

@Damien Picard (pioverfour) This commit cannot be the reason of the error because this limits the first frame to draw, so if you are in frame 60, nothing of frame 101 is displayed as it was before.

I have just recompile 2.92 master and running this command line blender.exe --factory-startup -b grease_pencil_render_bug.blend -a and I get the right result in .mp4 and .png format.

Edit: I run again and now get wrong frames.