How do I Include scene.camera name in render output filepath? So I have multiple cameras for different angles in my scene. I want the output file to be something like: renders\CAMERANAME\framenumber.png
It would be nice if this could be done automatically - currently I'm just typing the camera name in by hand, but I would like to streamline this so if I switch cameras it changes the folder for me.
I have been trying to use python but I am not very good and not sure how to do what I want.
this is as far as I got(not very far haha)
import bpy
import os

scn = bpy.context.scene

path = scn.render.filepath
cam = scn.camera

scn.render.filepath = path + cam +scn.frame
the script automatically creates the directories with your cams names. If it is already there, the script just puts the animated pics in these folders.
check this out:
import bpy
import os

scene = bpy.context.scene

oldPath = bpy.context.scene.render.filepath

for ob in scene.objects:
    if ob.type == 'CAMERA':
        bpy.context.scene.camera = ob
       
        filepath = bpy.context.scene.render.filepath
       
#        filepath = bpy.data.filepath # blend file
        directory = os.path.dirname(filepath)
       
        name = ob.name + &quot;/&quot;

        directory_to_test = os.path.join(filepath, name)

        if not os.path.exists(directory_to_test):
            os.makedirs(directory_to_test)
            print(&quot;created directory: &quot;, directory_to_test)
            
        file = directory_to_test + &quot;render&quot;
            
        bpy.context.scene.render.filepath = file
        
#        bpy.ops.render.render( write_still=True )
        
        bpy.ops.render.render(animation=True) 
        
        bpy.context.scene.render.filepath = oldPath