2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-21 10:26:39 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-21 10:26:39 +00:00
|
|
|
class Buttons_HT_header(bpy.types.Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
so = context.space_data
|
|
|
|
scene = context.scene
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
row = layout.row(align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
row.template_header()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("Buttons_MT_view", text="View")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(so, "buttons_context", expand=True, text="")
|
2010-04-01 21:44:56 +00:00
|
|
|
row.prop(scene, "frame_current")
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-21 10:26:39 +00:00
|
|
|
class Buttons_MT_view(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "View"
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
so = context.space_data
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
col = layout.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(so, "panel_alignment", expand=True)
|
2009-06-21 10:26:39 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
classes = [
|
|
|
|
Buttons_HT_header,
|
|
|
|
Buttons_MT_view]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|