[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51386] trunk/blender/release/scripts/ templates/script_stub.py: add a template for a stub script - runs the script relative to the currently open blend file .

Campbell Barton ideasman42 at gmail.com
Wed Oct 17 18:01:57 CEST 2012


Revision: 51386
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51386
Author:   campbellbarton
Date:     2012-10-17 16:01:57 +0000 (Wed, 17 Oct 2012)
Log Message:
-----------
add a template for a stub script - runs the script relative to the currently open blend file.

Added Paths:
-----------
    trunk/blender/release/scripts/templates/script_stub.py

Added: trunk/blender/release/scripts/templates/script_stub.py
===================================================================
--- trunk/blender/release/scripts/templates/script_stub.py	                        (rev 0)
+++ trunk/blender/release/scripts/templates/script_stub.py	2012-10-17 16:01:57 UTC (rev 51386)
@@ -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'))


Property changes on: trunk/blender/release/scripts/templates/script_stub.py
___________________________________________________________________
Added: svn:eol-style
   + native




More information about the Bf-blender-cvs mailing list