# rendering depth images non consecutive frames -via python

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?

• Normally blender only saves the final result. You can use a file output node to automate saving any other render data to file. Feb 22 '17 at 1:20
• 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 Feb 23 '17 at 10:34
• 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. Feb 23 '17 at 16:02
• AttributeError: 'CompositorNodeOutputFile' object has no attribute 'sub_path' Feb 23 '17 at 16:43
• 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' Feb 24 '17 at 8:12