Forrest logo
back to the blender tool

blender:tldr:0f021

blender: Render an animation at a specific resolution, by passing a Python expression.
$ blender --background ${filename}.blend --python-expr '${import bpy; bpy-data-scenes[0]-render-resolution_percentage = 25}' --render-anim
try on your machine

This command is using the Blender software in the background mode to run a specific Python script and render an animation. Here is a breakdown of each part of the command:

  1. blender: It is the executable file for the Blender software, implying that we want to run Blender from the command line.

  2. --background: This flag tells Blender to run in background mode, meaning it will not open a graphical user interface (GUI) window.

  3. ${filename}.blend: ${filename} is a placeholder that represents the name of the Blender project file (.blend) you want to render. This command assumes that there is a variable named filename that holds the desired name of the file. For example, if filename = "example", then Blender will open and render the file named "example.blend".

  4. --python-expr: This flag indicates that the following argument is a Python expression that Blender needs to execute during its startup process.

  5. '${import bpy; bpy-data-scenes[0]-render-resolution_percentage = 25}': This Python expression uses Blender's Python API to modify the render resolution percentage of the first scene in the loaded Blender project. It sets the resolution percentage to 25, meaning the output will be rendered at a quarter of its original resolution. Note that the expression could be incorrect due to a typo or invalid syntax. It is likely meant to be written as 'import bpy; bpy.data.scenes[0].render.resolution_percentage = 25'.

  6. --render-anim: This flag means that Blender should render an animation instead of a still image. It instructs Blender to play through the timeline and generate the output frames according to the settings defined in the loaded Blender project.

In summary, executing this command will start Blender in background mode, load the specified Blender project, modify the resolution percentage, and render the animation based on the project's settings.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the blender tool