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,
|
|
|
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-28 05:09:25 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-05-28 05:09:25 +00:00
|
|
|
class OUTLINER_HT_header(bpy.types.Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'OUTLINER'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
space = context.space_data
|
|
|
|
scene = context.scene
|
|
|
|
ks = context.scene.active_keying_set
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("OUTLINER_MT_view")
|
2009-10-31 19:31:45 +00:00
|
|
|
if space.display_mode == 'DATABLOCKS':
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("OUTLINER_MT_edit_datablocks")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(space, "display_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if space.display_mode == 'DATABLOCKS':
|
|
|
|
row = layout.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("outliner.keyingset_add_selected", icon='ZOOMIN', text="")
|
|
|
|
row.operator("outliner.keyingset_remove_selected", icon='ZOOMOUT', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ks:
|
|
|
|
row = layout.row(align=False)
|
2009-11-23 11:43:38 +00:00
|
|
|
row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("anim.keyframe_insert", text="", icon='KEY_HLT')
|
|
|
|
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
row = layout.row(align=False)
|
2009-11-23 00:27:30 +00:00
|
|
|
row.label(text="No Keying Set active")
|
2009-05-28 05:09:25 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-05-28 05:09:25 +00:00
|
|
|
class OUTLINER_MT_view(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
if space.display_mode not in ('DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'):
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(space, "show_restriction_columns")
|
|
|
|
col.separator()
|
|
|
|
col.operator("outliner.show_active")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("outliner.show_one_level")
|
|
|
|
col.operator("outliner.show_hierarchy")
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-12-03 16:28:50 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-12-03 16:28:50 +00:00
|
|
|
layout.operator("screen.area_dupli")
|
|
|
|
layout.operator("screen.screen_full_area")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-21 05:59:51 +00:00
|
|
|
class OUTLINER_MT_edit_datablocks(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Edit"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("outliner.keyingset_add_selected")
|
|
|
|
col.operator("outliner.keyingset_remove_selected")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.operator("outliner.drivers_add_selected")
|
|
|
|
col.operator("outliner.drivers_delete_selected")
|
2009-05-28 05:09:25 +00:00
|
|
|
|
|
|
|
bpy.types.register(OUTLINER_HT_header)
|
|
|
|
bpy.types.register(OUTLINER_MT_view)
|
2009-10-21 05:59:51 +00:00
|
|
|
bpy.types.register(OUTLINER_MT_edit_datablocks)
|