Skip to Content
DocumentationPython ScriptingEnvironment Variables

Environment Variables

Brender Cloud automatically provides several environment variables that help control and customize the rendering process. You can also define custom variables during job submission.

Predefined Environment Variables

VariableDescriptionExample Usage
BC_OUTPUT_PATHThe output folder for the current server, where rendered frames and other files are saved.bpy.context.scene.render.filepath = os.path.join(os.getenv('BC_OUTPUT_PATH'), 'frame_####')
BC_SERVER_INDEXThe index of the current server within a server array; useful for distributing tasks.Set automatically during execution.
BC_SERVER_ARRAY_SIZETotal number of servers in use; this variable is only available when more than one server is active.Used to coordinate parallel tasks across servers.

Custom Environment Variables

When submitting a job, you can add custom environment variables by clicking the Add Env button. These key-value pairs are then accessible within your script, allowing you to pass parameters or configuration options without modifying the code.

Use Case Example

Custom variables can be used to dynamically adjust render settings or enable experimental features.

import os # Access custom environment variables custom_var = os.getenv('CUSTOM_VAR') # Use custom variable in script if custom_var == 'true': bpy.context.scene.render.resolution_x = 1920 bpy.context.scene.render.resolution_y = 1080
Last updated on