2.5:
[blender.git] / release / ui / space_view3d.py
1
2 import bpy
3
4 class VIEW3D_MT_view_navigation(bpy.types.Menu):
5         __space_type__ = "VIEW_3D"
6         __label__ = "Navigation"
7
8         def draw(self, context):
9                 layout = self.layout
10
11                 # layout.itemO("VIEW3D_OT_view_fly_mode")
12                 # layout.itemS()
13                 
14                 layout.items_enumO("VIEW3D_OT_view_orbit", "type")
15                 
16                 layout.itemS()
17                 
18                 layout.items_enumO("VIEW3D_OT_view_pan", "type")
19                 
20                 layout.itemS()
21                 
22                 layout.item_floatO("VIEW3D_OT_zoom", "delta", 1.0, text="Zoom In")
23                 layout.item_floatO("VIEW3D_OT_zoom", "delta", -1.0, text="Zoom Out")
24
25 class VIEW3D_MT_view(bpy.types.Menu):
26         __space_type__ = "VIEW_3D"
27         __label__ = "View"
28
29         def draw(self, context):
30                 layout = self.layout
31
32                 layout.itemO("VIEW3D_OT_properties", icon="ICON_MENU_PANEL")
33                 layout.itemO("VIEW3D_OT_toolbar", icon="ICON_MENU_PANEL")
34                 
35                 layout.itemS()
36                 
37                 layout.item_enumO("VIEW3D_OT_viewnumpad", "type", "CAMERA")
38                 layout.item_enumO("VIEW3D_OT_viewnumpad", "type", "TOP")
39                 layout.item_enumO("VIEW3D_OT_viewnumpad", "type", "FRONT")
40                 layout.item_enumO("VIEW3D_OT_viewnumpad", "type", "RIGHT")
41                 
42                 # layout.itemM("VIEW3D_MT_view_cameras", text="Cameras")
43                 
44                 layout.itemS()
45
46                 layout.itemO("VIEW3D_OT_view_persportho")
47                 
48                 layout.itemS()
49                 
50                 # layout.itemO("VIEW3D_OT_view_show_all_layers")
51                 
52                 # layout.itemS()
53                 
54                 # layout.itemO("VIEW3D_OT_view_local_view")
55                 # layout.itemO("VIEW3D_OT_view_global_view")
56                 
57                 # layout.itemS()
58                 
59                 layout.itemM("VIEW3D_MT_view_navigation")
60                 # layout.itemM("VIEW3D_MT_view_align", text="Align View")
61                 
62                 layout.itemS()
63
64                 layout.operator_context = "INVOKE_REGION_WIN"
65
66                 layout.itemO("VIEW3D_OT_clip_border")
67                 layout.itemO("VIEW3D_OT_zoom_border")
68                 
69                 layout.itemS()
70                 
71                 layout.itemO("VIEW3D_OT_view_center")
72                 layout.itemO("VIEW3D_OT_view_all")
73                 
74                 layout.itemS()
75                 
76                 layout.itemO("SCREEN_OT_screen_full_area")
77
78 class VIEW3D_HT_header(bpy.types.Header):
79         __space_type__ = "VIEW_3D"
80
81         def draw(self, context):
82                 layout = self.layout
83
84                 layout.template_header()
85
86                 # menus
87                 if context.area.show_menus:
88                         row = layout.row()
89                         row.itemM("VIEW3D_MT_view")
90
91                 layout.template_header_3D()
92
93 class VIEW3D_PT_random_panel(bpy.types.Panel):
94         __space_type__ = "VIEW_3D"
95         __region_type__ = "UI"
96         __label__ = "Random Panel"
97
98         def draw(self, context):
99                 layout = self.layout
100                 layout.itemL(text="panel contents")
101
102 bpy.types.register(VIEW3D_MT_view_navigation)
103 bpy.types.register(VIEW3D_MT_view)
104 bpy.types.register(VIEW3D_HT_header)
105 bpy.types.register(VIEW3D_PT_random_panel)
106