Skip to content

Instantly share code, notes, and snippets.

@p2or
Last active May 21, 2023 19:44
Show Gist options
  • Save p2or/8e137d85898e2d93f394ae267acd1e6e to your computer and use it in GitHub Desktop.
Save p2or/8e137d85898e2d93f394ae267acd1e6e to your computer and use it in GitHub Desktop.
Call Bashfile #BlenderAddon
# http://blender.stackexchange.com/q/76655/31447
import bpy
import subprocess
import os
bpy.ops.mesh.primitive_cube_add(radius=1)
bashfile = '/home/.../hello-world.sh'
os.chmod(bashfile, 0o777) # http://stackoverflow.com/a/1837896
p = subprocess.Popen(bashfile, stdout=subprocess.PIPE)
output, err = p.communicate()
p_status = p.wait()
print (output)
bpy.ops.mesh.primitive_monkey_add(radius=1)
#!/bin/bash
echo Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment