Last active
May 21, 2023 19:44
-
-
Save p2or/8e137d85898e2d93f394ae267acd1e6e to your computer and use it in GitHub Desktop.
Call Bashfile #BlenderAddon
This file contains hidden or 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
# 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) |
This file contains hidden or 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
#!/bin/bash | |
echo Hello World |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment