diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-30 05:39:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-30 05:39:55 +0400 |
commit | 33955940e4931e2184434393e0f8c15c36a5c3c6 (patch) | |
tree | 7b3c10343162a256e85ff4346f57122032715e82 /release/scripts/templates_py/ui_menu_simple.py | |
parent | e12354c4c5850864f925d22f53ec31578384bc63 (diff) |
add templates menu for OSL, use preprocessor directive color for decorators in python.
Diffstat (limited to 'release/scripts/templates_py/ui_menu_simple.py')
-rw-r--r-- | release/scripts/templates_py/ui_menu_simple.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/release/scripts/templates_py/ui_menu_simple.py b/release/scripts/templates_py/ui_menu_simple.py new file mode 100644 index 00000000000..2129dfd81a4 --- /dev/null +++ b/release/scripts/templates_py/ui_menu_simple.py @@ -0,0 +1,26 @@ +import bpy + + +class SimpleCustomMenu(bpy.types.Menu): + bl_label = "Simple Custom Menu" + bl_idname = "OBJECT_MT_simple_custom_menu" + + def draw(self, context): + layout = self.layout + + layout.operator("wm.open_mainfile") + layout.operator("wm.save_as_mainfile") + + +def register(): + bpy.utils.register_class(SimpleCustomMenu) + + +def unregister(): + bpy.utils.unregister_class(SimpleCustomMenu) + +if __name__ == "__main__": + register() + + # The menu can also be called from scripts + bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname) |