Simplifying material check thanks to the teachings of Master Campbell
[blender-addons.git] / space_view3d_3d_navigation.py
blobd0162b439ddb52dcd6982717766d5c96d1ceea73
1 # 3D NAVIGATION TOOLBAR v1.2 - 3Dview Addon - Blender 2.5x
3 # THIS SCRIPT IS LICENSED UNDER GPL,
4 # please read the license block.
6 # ##### BEGIN GPL LICENSE BLOCK #####
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software Foundation,
20 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # ##### END GPL LICENSE BLOCK #####
24 bl_addon_info = {
25 "name": "3D Navigation",
26 "author": "Demohero, uriel",
27 "version": (1, 2),
28 "blender": (2, 5, 4),
29 "api": 32411,
30 "location": "View3D > Toolbar",
31 "description": "Navigate the Camera & 3d Views",
32 "warning": "",
33 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
34 "Scripts/3D_interaction/3D_Navigation",
35 "tracker_url": "http://projects.blender.org/tracker/index.php?"\
36 "func=detail&aid=23530&group_id=153&atid=468",
37 "category": "3D View"}
39 # import the basic library
40 import bpy
42 # main class of this toolbar
43 class VIEW3D_PT_3dnavigationPanel(bpy.types.Panel):
44 bl_space_type = "VIEW_3D"
45 bl_region_type = "TOOLS"
46 bl_label = "3D Views "
48 def draw(self, context):
49 layout = self.layout
50 view = context.space_data
52 # Triple boutons
53 col = layout.column(align=True)
54 row = col.row()
55 row.operator("view3d.viewnumpad", text="View Camera", icon='CAMERA_DATA').type='CAMERA'
56 row = col.row()
57 row.operator("view3d.localview", text="View Global/Local")
58 row = col.row()
59 row.operator("view3d.view_persportho", text="View Persp/Ortho")
61 # group of 6 buttons
62 col = layout.column(align=True)
63 col.label(text="Align view from:")
64 row = col.row()
65 row.operator("view3d.viewnumpad", text="Front").type='FRONT'
66 row.operator("view3d.viewnumpad", text="Back").type='BACK'
67 row = col.row()
68 row.operator("view3d.viewnumpad", text="Left").type='LEFT'
69 row.operator("view3d.viewnumpad", text="Right").type='RIGHT'
70 row = col.row()
71 row.operator("view3d.viewnumpad", text="Top").type='TOP'
72 row.operator("view3d.viewnumpad", text="Bottom").type='BOTTOM'
73 row = col.row()
75 # group of 2 buttons
76 col = layout.column(align=True)
77 col.label(text="View to Object:")
78 col.prop(view, "lock_object", text="")
79 row = col.row()
80 row.operator("view3d.view_selected", text="View to Selected")
81 col = layout.column(align=True)
82 col.label(text="Cursor:")
83 row = col.row()
84 row.operator("view3d.snap_cursor_to_center", text="Center")
85 row.operator("view3d.view_center_cursor", text="View")
86 row = col.row()
87 row.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
89 # register the class
90 def register():
91 pass
93 def unregister():
94 pass
96 if __name__ == "__main__":
97 register()