# How can I specify filenames of animation renders as [SCENE NAME] + [FRAME] when rendering an image sequence?

I'm rendering out products from different angles. I set up keyframes to rotate the product to the desired angles, then I'm doing an image sequence animation render for each angle. Is there a way to specify the filenames to the scene name followed by either a custom name, or the frame number? Thank You!

• Have you tagged the question with 'python' and 'scripting' because you are triggering the rendering by code? Jan 26 '17 at 16:52

bpy.context.scene.name             ...   the scene's name
bpy.context.scene.frame_start      ...   the scene's starting frame


import bpy

scene = bpy.context.scene
fp = scene.render.filepath # get existing output path

for frame_nr in range(scene.frame_start, scene.frame_end):

# set current frame
scene.frame_set(frame_nr)

# set output path
scene.render.filepath = "//render/" + scene.name + "_folder/" + scene.name + "_customName_" + '{0:03d}'.format(frame_nr)
bpy.ops.render.render(write_still=True)
scene.render.filepath = fp


Refer to:

For what I needed, I just specified the file path names, starting with the product name and then it added the frame name to the end.