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-05-28 05:09:25 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Header, Menu
|
2009-05-28 05:09:25 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OUTLINER_HT_header(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
|
2010-08-23 22:16:45 +00:00
|
|
|
ks = context.scene.keying_sets.active
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
|
|
|
|
2014-01-27 07:38:53 +00:00
|
|
|
OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
|
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
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(space, "filter_text", icon='VIEWZOOM', text="")
|
2010-04-22 18:17:17 +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:
|
2013-08-23 20:41:21 +00:00
|
|
|
row = layout.row()
|
2010-08-24 03:02:27 +00:00
|
|
|
row.prop_search(scene.keying_sets, "active", 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:
|
2013-08-23 20:41:21 +00:00
|
|
|
row = layout.row()
|
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
|
|
|
|
2014-01-27 07:38:53 +00:00
|
|
|
class OUTLINER_MT_editor_menus(Menu):
|
|
|
|
bl_idname = "OUTLINER_MT_editor_menus"
|
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
self.draw_menus(self.layout, context)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def draw_menus(layout, context):
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
layout.menu("OUTLINER_MT_view")
|
|
|
|
layout.menu("OUTLINER_MT_search")
|
|
|
|
|
|
|
|
if space.display_mode == 'DATABLOCKS':
|
|
|
|
layout.menu("OUTLINER_MT_edit_datablocks")
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OUTLINER_MT_view(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
space = context.space_data
|
|
|
|
|
2011-03-07 13:23:45 +00:00
|
|
|
if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'}:
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.prop(space, "show_restrict_columns")
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("outliner.show_active")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.operator("outliner.show_one_level")
|
|
|
|
layout.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")
|
2014-10-14 18:05:44 +00:00
|
|
|
layout.operator("screen.screen_full_area", text="Toggle Maximize Area")
|
|
|
|
layout.operator("screen.screen_full_area").use_hide_panels = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-05-03 16:00:42 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OUTLINER_MT_search(Menu):
|
2010-04-23 03:53:05 +00:00
|
|
|
bl_label = "Search"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
space = context.space_data
|
|
|
|
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.prop(space, "use_filter_case_sensitive")
|
|
|
|
layout.prop(space, "use_filter_complete")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-05-03 16:00:42 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class OUTLINER_MT_edit_datablocks(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Edit"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.operator("outliner.keyingset_add_selected")
|
|
|
|
layout.operator("outliner.keyingset_remove_selected")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-08-13 17:52:13 +00:00
|
|
|
layout.operator("outliner.drivers_add_selected")
|
|
|
|
layout.operator("outliner.drivers_delete_selected")
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|