import bpy
import sys
import os
def execAbsolute(path, dict=None):
srcCode = open(path).read()
if dict is None:
dict = globals()
exec( compile(srcCode, path, 'exec'), dict)
def execRelative(path, dict=None):
path2 = os.path.join(os.path.dirname(bpy.data.filepath), path)
execAbsolute(path2, dict)
fname = "/tmp/blender-city/city.lores.py"
print("loading %s" %fname)
execAbsolute(fname)
|
Blender python API quick-start
Syntax highlighting by Pygments.