I refered to this post in the following link and I know this is usually done with

 scene.render.filepath = fp + str(frame_nr)
 bpy.ops.render.render(write_still=True) # render still

from : Python Render Specific Frames However, this only stores the colour images. Not the Z buffer lined to a path. How can I do it?

could any one please tell me how to do it for the depth images?

  • $\begingroup$ Normally blender only saves the final result. You can use a file output node to automate saving any other render data to file. $\endgroup$
    – sambler
    Feb 22, 2017 at 1:20
  • $\begingroup$ Yes , but I need to change the name of the file.I can only change the basepath if I am using outputnodes , not the file names $\endgroup$
    – p.Neu
    Feb 23, 2017 at 10:34
  • $\begingroup$ The base path is the top directory of all files and is added to the beginning of the subpath for each connection. The subpath uses the same filename rules as the normal render output settings, which adds the frame number to the filename. If you really need it, you could change the file output node settings before rendering each frame. $\endgroup$
    – sambler
    Feb 23, 2017 at 16:02
  • $\begingroup$ AttributeError: 'CompositorNodeOutputFile' object has no attribute 'sub_path' $\endgroup$
    – p.Neu
    Feb 23, 2017 at 16:43
  • $\begingroup$ The output file node has the base_path and file_slots which is a list of connections that contain the subpath in their path property - fnode.file_slots[0].path='filename' $\endgroup$
    – sambler
    Feb 24, 2017 at 8:12


You must log in to answer this question.

Browse other questions tagged .