6

I working on an addon and i need to run an opengl render by subprocess. When i run my script test, i've got this error:

RuntimeError: Error: Cannot use OpenGL render in background mode (no opengl context)

This is my command:

sub = subprocess.Popen([bpy.app.binary_path, blendfile, '-b', '--python', render_script])

Does it mean we can't do opengl render in Background ?

pistiwique
  • 1,106
  • 9
  • 22

1 Answers1

3

No, you can't use OpenGL in the background. You shouldn't use the -b flag, and instead, close Blender in the end of your script using bpy.ops.wm.quit_blender().

Blender creates screenshot using python script but not when running in background

Render with openGL from the command line?

batFINGER
  • 84,216
  • 10
  • 108
  • 233
Noam Peled
  • 479
  • 4
  • 18