diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-07-26 11:39:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-07-26 11:39:00 +0400 |
commit | 71692e802fc50ad9dd76659d2868843e708dbd40 (patch) | |
tree | bbdccf1ef33cc577b0fcb900508caafe6bae3531 /release/scripts/templates/ui_panel_simple.py | |
parent | 5b3906728fa358fccd857cbeca85ff102df6e6c7 (diff) |
py api:
- added menu templates
- move template menu into the header of the text editor (so users will find more easily)
- updated mathutils examples, switching the order of multiplication.
Diffstat (limited to 'release/scripts/templates/ui_panel_simple.py')
-rw-r--r-- | release/scripts/templates/ui_panel_simple.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/release/scripts/templates/ui_panel_simple.py b/release/scripts/templates/ui_panel_simple.py new file mode 100644 index 00000000000..cde6126b626 --- /dev/null +++ b/release/scripts/templates/ui_panel_simple.py @@ -0,0 +1,34 @@ +import bpy + + +class HelloWorldPanel(bpy.types.Panel): + bl_label = "Hello World Panel" + bl_idname = "OBJECT_PT_hello" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "object" + + def draw(self, context): + layout = self.layout + + obj = context.object + + row = layout.row() + row.label(text="Hello world!", icon='WORLD_DATA') + + row = layout.row() + row.label(text="Active object is: " + obj.name) + row = layout.row() + row.prop(obj, "name") + + +def register(): + bpy.utils.register_class(HelloWorldPanel) + + +def unregister(): + bpy.utils.unregister_class(HelloWorldPanel) + + +if __name__ == "__main__": + register() |