1

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!

Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125
Design Ninja
  • 57
  • 1
  • 4

2 Answers2

1

This answer already explains how to render certain frames.

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:

Leander
  • 26,725
  • 2
  • 44
  • 105
0

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.

Design Ninja
  • 57
  • 1
  • 4