This repository has been archived on 2026-10-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
geometry-script/external.py
2022-11-13 18:49:09 -05:00

11 lines
No EOL
343 B
Python

import bpy
import os
def load(filename):
"""
Execute an external script.
"""
filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
global_namespace = {"__file__": filepath, "__name__": "__main__"}
with open(filepath, 'rb') as file:
exec(compile(file.read(), filepath, 'exec'), global_namespace)