Skip to content

Instantly share code, notes, and snippets.

@ali1234
ali1234 / blender-script.py
Created October 29, 2018 01:52
A Python script which runs itself inside Blender upon being run from the command line. Passes through command line arguments.
#!/usr/bin/env python3
import sys
try:
import bpy
except ImportError:
print('Running myself inside Blender')
import subprocess
exit(subprocess.call(['blender', '--background', '--python', __file__, '--'] + sys.argv))