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, 57, 0),
29 "location": "View3D > Tool Shelf > 3D Nav",
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 "tracker_url": "http://projects.blender.org/tracker/index.php?"\
35 "func=detail&aid=23530",
36 "category": "3D View"}
38 # import the basic library
41 # main class of this toolbar
42 class VIEW3D_PT_3dnavigationPanel(bpy
.types
.Panel
):
43 bl_space_type
= "VIEW_3D"
44 bl_region_type
= "TOOLS"
46 bl_options
= {"DEFAULT_CLOSED"}
48 def draw(self
, context
):
50 view
= context
.space_data
53 col
= layout
.column(align
=True)
54 col
.operator("view3d.viewnumpad", text
="View Camera", icon
='CAMERA_DATA').type='CAMERA'
55 col
.operator("view3d.localview", text
="View Global/Local")
56 col
.operator("view3d.view_persportho", text
="View Persp/Ortho")
59 col
= layout
.column(align
=True)
60 col
.label(text
="Align view from:")
62 row
.operator("view3d.viewnumpad", text
="Front").type='FRONT'
63 row
.operator("view3d.viewnumpad", text
="Back").type='BACK'
65 row
.operator("view3d.viewnumpad", text
="Left").type='LEFT'
66 row
.operator("view3d.viewnumpad", text
="Right").type='RIGHT'
68 row
.operator("view3d.viewnumpad", text
="Top").type='TOP'
69 row
.operator("view3d.viewnumpad", text
="Bottom").type='BOTTOM'
72 col
= layout
.column(align
=True)
73 col
.label(text
="View to Object:")
74 col
.prop(view
, "lock_object", text
="")
75 col
.operator("view3d.view_selected", text
="View to Selected")
77 col
= layout
.column(align
=True)
78 col
.label(text
="Cursor:")
81 row
.operator("view3d.snap_cursor_to_center", text
="Center")
82 row
.operator("view3d.view_center_cursor", text
="View")
84 col
.operator("view3d.snap_cursor_to_selected", text
="Cursor to Selected")
88 bpy
.utils
.register_module(__name__
)
93 bpy
.utils
.unregister_module(__name__
)
97 if __name__
== "__main__":