Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| 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) |
| # https://blender.stackexchange.com/q/57306/3710 | |
| bl_info = { | |
| "name": "Add-on Template", | |
| "description": "", | |
| "author": "p2or", | |
| "version": (0, 0, 3), | |
| "blender": (2, 80, 0), | |
| "location": "3D View > Tools", | |
| "warning": "", # used for warning icon and text in addons panel |
| import { join } from 'path' | |
| import { readdir, stat } from 'fs-promise' | |
| async function rreaddir (dir, allFiles = []) { | |
| const files = (await readdir(dir)).map(f => join(dir, f)) | |
| allFiles.push(...files) | |
| await Promise.all(files.map(async f => ( | |
| (await stat(f)).isDirectory() && rreaddir(f, allFiles) | |
| ))) | |
| return allFiles |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| import bpy | |
| # current scene | |
| scn = bpy.context.scene | |
| # path to the blend | |
| filepath = "/path/to/file.blend" | |
| # name of object to import | |
| obj_name = "Cube" |
| #!/bin/bash -e | |
| ln -s /usr/lib/x86_64-linux-gnu/amdgpu-pro . | |
| ln -s /etc/OpenCL . | |
| tar -czvf libs.tar.gz amdgpu-pro/* | |
| tar -czvf conf.tar.gz OpenCL/* | |
| cat > .dockerignore << EOF | |
| OpenCL |
| #!/bin/bash | |
| # Install host GPU drivers | |
| # ... | |
| # Start a bare X-server | |
| X :0 & | |
| # Make it possible to connect from other hosts | |
| export DISPLAY=:0 | |
| xhost + |
sudo apt-get install xserver-xorg-legacy
Edit /etc/X11/Xwrapper.config
allowed_users=anybody
needs_root_rights=yes