Last active
March 22, 2024 01:27
-
-
Save odinndagur/495bb9ffae77d7d83220c6bc0688b625 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bpy | |
| import os | |
| current_filepath = bpy.context.scene.render.filepath #filepathið sem er stillt í byrjun (folderinn sem á að geyma alla folderana) | |
| for camera in bpy.data.cameras: #loopa yfir allar myndavélar í sceneinu | |
| if bpy.data.objects[camera.name].hide_render: #ekki gera neitt ef er ekki kveikt á render takkanum | |
| continue | |
| bpy.data.scenes[0].camera = bpy.data.objects[camera.name] #stilla nýja active camera | |
| new_filepath = os.path.join(current_filepath,camera.name,'') #nýtt filepath sem er gamla + nafnið á myndavélinni + / eða \ eftir þvi hvort mac eða win | |
| bpy.context.scene.render.filepath = new_filepath #setja nýja filepathið í staðinn fyrir gamla | |
| bpy.ops.render.render(animation=True) #setja render í gang (animation = False til að fá bara still) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment