[Durian-svn] [2363] menu item to add compo finals py script
campbell
institute at blender.org
Thu Apr 22 16:44:41 CEST 2010
Revision: 2363
https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=2363
Author: campbell
Date: 2010-04-22 16:44:41 +0200 (Thu, 22 Apr 2010)
Log Message:
-----------
menu item to add compo finals py script
Added Paths:
-----------
pro/scripts/ui/space_text_scripts.py
Added: pro/scripts/ui/space_text_scripts.py
===================================================================
--- pro/scripts/ui/space_text_scripts.py (rev 0)
+++ pro/scripts/ui/space_text_scripts.py 2010-04-22 14:44:41 UTC (rev 2363)
@@ -0,0 +1,37 @@
+
+import bpy
+
+def main(context):
+
+ text = """import finals_config
+reload(finals_config)
+finals_config.setup(baked=False)"""
+
+ textblock = bpy.data.texts.new("durian_init.py")
+ textblock.write(text)
+ textblock.use_module = True
+ context.space_data.text = textblock
+
+class DurianInit(bpy.types.Operator):
+ ''''''
+ bl_idname = "text.durian_init"
+ bl_label = "Durian Finals Init"
+
+ def execute(self, context):
+ main(context)
+ return {'FINISHED'}
+
+def menu_func(self, context):
+ self.layout.operator(DurianInit.bl_idname)
+
+def register():
+ bpy.types.register(DurianInit)
+ bpy.types.TEXT_MT_text.append(menu_func)
+
+def unregister():
+ bpy.types.unregister(DurianInit)
+ bpy.types.TEXT_MT_text.append(menu_func)
+
+
+if __name__ == "__main__":
+ register()
More information about the Durian-svn
mailing list