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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # ##### END GPL LICENSE BLOCK #####
25 "name": "3D Navigation",
26 "author": "Demohero, uriel",
28 "blender": (2, 71, 0),
29 "location": "View3D > Tool Shelf > 3D Navigation Tab",
30 "description": "Navigate the Camera & 3D View from the Toolshelf",
32 "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
33 "Scripts/3D_interaction/3D_Navigation",
34 "category": "3D View",
37 # import the basic library
40 # main class of this toolbar
41 class VIEW3D_PT_3dnavigationPanel(bpy
.types
.Panel
):
42 bl_category
= "Navigation"
43 bl_space_type
= "VIEW_3D"
44 bl_region_type
= "TOOLS"
47 def draw(self
, context
):
49 view
= context
.space_data
52 col
= layout
.column(align
=True)
53 col
.operator("view3d.viewnumpad", text
="View Camera", icon
='CAMERA_DATA').type='CAMERA'
54 col
.operator("view3d.localview", text
="View Global/Local")
55 col
.operator("view3d.view_persportho", text
="View Persp/Ortho")
58 col
= layout
.column(align
=True)
59 col
.label(text
="Align view from:")
61 row
.operator("view3d.viewnumpad", text
="Front").type='FRONT'
62 row
.operator("view3d.viewnumpad", text
="Back").type='BACK'
64 row
.operator("view3d.viewnumpad", text
="Left").type='LEFT'
65 row
.operator("view3d.viewnumpad", text
="Right").type='RIGHT'
67 row
.operator("view3d.viewnumpad", text
="Top").type='TOP'
68 row
.operator("view3d.viewnumpad", text
="Bottom").type='BOTTOM'
71 col
= layout
.column(align
=True)
72 col
.label(text
="View to Object:")
73 col
.prop(view
, "lock_object", text
="")
74 col
.operator("view3d.view_selected", text
="View to Selected")
76 col
= layout
.column(align
=True)
77 col
.label(text
="Cursor:")
80 row
.operator("view3d.snap_cursor_to_center", text
="Center")
81 row
.operator("view3d.view_center_cursor", text
="View")
83 col
.operator("view3d.snap_cursor_to_selected", text
="Cursor to Selected")
87 bpy
.utils
.register_module(__name__
)
92 bpy
.utils
.unregister_module(__name__
)
96 if __name__
== "__main__":