when render animation with frame end 20 and step 4, will get 5 output file name like this:
0001.png,0005.png,0009.png,0013.png,0017.png
it possible to get output name like this ?.
0001.png,0002.png,0003.png,0004.png,0005.png
when render animation with frame end 20 and step 4, will get 5 output file name like this:
0001.png,0005.png,0009.png,0013.png,0017.png
it possible to get output name like this ?.
0001.png,0002.png,0003.png,0004.png,0005.png
After render.
If you have set the render file path such that it only contains the rendered images with that file extension, can run this script, from within the blender text editor, after rendering.
import bpy
from pathlib import Path
op = 'RENAME' # to rename
#op = 'CLEAN' # to remove
context = bpy.context
scene = context.scene
render = scene.render
ext = render.file_extension
rfp = Path(render.filepath)
fldr = rfp if rfp.is_dir() else rfp.parent
for f in sorted(fldr.glob(f"*{ext}")):
if op == 'CLEAN':
f.unlink()
elif op == 'RENAME':
print(f.name, end=" -> ")
num = int(f.stem) // scene.frame_step + 1
f2 = fldr / f"{num : 05d}{ext}"
if not f2.exists():
f.rename(f2)
print(f2.name)
Output after rename.
0001.png -> 0001.png
0005.png -> 0002.png
0009.png -> 0003.png
0013.png -> 0004.png
0017.png -> 0005.png