add a template for a stub script - runs the script relative to the currently open blend file.

This commit is contained in:
Campbell Barton 2012-10-17 16:01:57 +00:00
parent 20585a8b8d
commit f83ae34e03

@ -0,0 +1,11 @@
# This stub runs a python script relative to the currently open
# blend file, useful when editing scripts externally.
import bpy
import os
# Use your own script name here:
filename = "my_script.py"
filepath = os.path.join(os.path.basename(bpy.data.filepath), filename)
exec(compile(open(filepath).read(), filepath, 'exec'))