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
Variable | Description | Example Usage |
---|---|---|
BC_OUTPUT_PATH | The 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_INDEX | The index of the current server within a server array; useful for distributing tasks. | Set automatically during execution. |
BC_SERVER_ARRAY_SIZE | Total 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