I am trying to modify a little bit the source code of blender to fit it to my needs. Does anybody know which function is responsible for saving a rendered image to file? Thanks in advance.

What I would be interested in is how to invoke the whole 'saving image' procedure, which is called for example after every frame in rendering an animation. I just want to call such a function in the process of rendering.

  • 1
    $\begingroup$ Have a look into source/blender/imbuf to add a new format and source/blender/editors/space_image/image_ops.c to edit how blender saves the image. Also this old diagram from the wiki should help. You can also try the official IRC channel. $\endgroup$ – brockmann Apr 18 '18 at 17:16
  • 1
    $\begingroup$ Are you sure you need to go as deep as source code? I've made loads of post-render things using python and app handlers docs.blender.org/api/2.79/bpy.app.handlers.html $\endgroup$ – kheetor Apr 19 '18 at 11:52
  • $\begingroup$ Those handlers might be a solution, unfortunately, I don't know how to save currently rendered image from handler call. When I use function bpy.ops.image.save() I get the error: RuntimeError: Operator bpy.ops.image.save() failed, context is incorrect. Any help? $\endgroup$ – Krzysztof Wolski Apr 20 '18 at 7:08

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.