0
$\begingroup$

Hello :) is there any expression for naming the render with the scene name ? something like that :

blender -b "F:\Test_Anim\Test_Anim.blend" -o //Render/<scene_name>/<scene_name>_### -S Sphere -a

blender -b "F:\Test_Anim\Test_Anim.blend" -o //Render/<scene_name>/<scene_name>_### -S Cube -a

Thank you

$\endgroup$
4
  • $\begingroup$ How do you know what commands to run for rendering with command line with Blender? $\endgroup$ Commented Aug 1, 2024 at 8:58
  • $\begingroup$ docs.blender.org/manual/en/latest/advanced/command_line/… $\endgroup$ Commented Aug 1, 2024 at 9:01
  • $\begingroup$ related blender.stackexchange.com/questions/269699/… $\endgroup$ Commented Aug 1, 2024 at 9:10
  • $\begingroup$ @HarryMcKenzie I saw this, but my knowledge in python are very limited. I don't want any button, juste lunch the script and the name applied for every scenes.. $\endgroup$ Commented Aug 1, 2024 at 10:24

1 Answer 1

0
$\begingroup$

So I find a solution. I created 1 script to auto fill the output path witch use the scenes name to create a subfolder and name the export files :

import bpy
import os

blend_filepath = bpy.data.filepath

project_dir = os.path.dirname(blend_filepath)

parent_dir = os.path.dirname(project_dir)

render_dir = os.path.join(parent_dir, '04_RENDER')

if not os.path.exists(render_dir):
    os.makedirs(render_dir)

new_folder_name = "NameExemple"
new_folder_path = os.path.join(render_dir, new_folder_name)

if not os.path.exists(new_folder_path):
    os.makedirs(new_folder_path)

for scene in bpy.data.scenes:

    scene_name = scene.name

    render_path = os.path.join(new_folder_path,f"{scene_name}\{scene_name}_###")

    scene.render.filepath = render_path

Then i created a script to create a text file with the command to lunch the render via the command line :

import bpy
import os

blend_file_path = bpy.data.filepath

file_path = bpy.path.abspath("//render_all_scenes.txt")

with open(file_path, 'w') as file:
    for scene in bpy.data.scenes:
        file.write(f"blender -b {blend_file_path}  -S {scene.name} -a\n")
        file.write("\n")
$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.