5
$\begingroup$

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 ?

$\endgroup$
2
$\begingroup$

Yes, 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(). You can get more info here and here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.