This line of code worked fine until I dropped it into a function. Now when it executes, blender shuts down without throwing an error:

bpy.ops.render.render(use_viewport = True, write_still=True)

The error likely has nothing to do with the code, but maybe has tapped into an internal corruption within Blender?

Has anyone ever encountered this before? Possible solutions?

  • $\begingroup$ Does rendering through the UI work properly (F12)? You can run Blender from the terminal with --debug to get error messages or on Windows blender_debug_gpu.cmd in Blender's install directory by double-clicking on it (this will create a log file). $\endgroup$ – Robert Gützkow Sep 13 at 12:44
  • $\begingroup$ how often is that line of code executed by the function you put it in? ..instead of that line can you write print('happens') and see if it's executed perhaps more often than you realize? $\endgroup$ – zeffii Sep 13 at 16:29

Your Answer

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

Browse other questions tagged or ask your own question.