Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/templates/script_stub.py')
-rw-r--r--release/scripts/templates/script_stub.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/templates/script_stub.py b/release/scripts/templates/script_stub.py
index 3b3212892d5..143c7c5104a 100644
--- a/release/scripts/templates/script_stub.py
+++ b/release/scripts/templates/script_stub.py
@@ -8,4 +8,5 @@ import os
filename = "my_script.py"
filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
-exec(compile(open(filepath).read(), filepath, 'exec'))
+global_namespace = {"__file__": filepath, "__name__": "__main__"}
+exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace)