Last active
January 18, 2020 01:52
-
-
Save Mikulas/2c9acb5f7bd716dff6cedfecf6592a60 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# https://blender.stackexchange.com/questions/5281/blender-sets-compute-device-cuda-but-doesnt-use-it-for-actual-render-on-ec2 | |
bpy.context.user_preferences.addons['cycles'].preferences.compute_device_type = 'CUDA' | |
bpy.context.user_preferences.addons['cycles'].preferences.devices[0].use = True | |
bpy.context.scene.cycles.device = 'GPU' | |
bpy.data.scenes["Scene"].render.filepath = "/tmp/output.png" | |
bpy.ops.render.render(write_still=True) |
This file contains 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
BLEND="/tmp/foo.blend" | |
/home/ec2-user/blender --background "$BLEND" \ | |
--use-extension 1 \ | |
-noaudio -nojoystick \ | |
-E CYCLES -t 0 \ | |
-P "config.py" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment