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
|
|
|
|
|
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
|
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()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("OUTLINER_MT_view")
|
2010-04-23 03:53:05 +00:00
|
|
|
sub.menu("OUTLINER_MT_search")
|
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
|
|
|
|
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:
|
|
|
|
row = layout.row(align=False)
|
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:
|
|
|
|
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()
|
2011-03-07 13:23:45 +00:00
|
|
|
if space.display_mode not in {'DATABLOCKS', 'USER_PREFERENCES', 'KEYMAPS'}:
|
2010-08-17 07:49:53 +00:00
|
|
|
col.prop(space, "show_restrict_columns")
|
2009-11-23 00:27:30 +00:00
|
|
|
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
|
|
|
|
2010-05-03 16:00:42 +00:00
|
|
|
|
2010-04-23 03:53:05 +00:00
|
|
|
class OUTLINER_MT_search(bpy.types.Menu):
|
|
|
|
bl_label = "Search"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
space = context.space_data
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
col.prop(space, "use_filter_case_sensitive")
|
|
|
|
col.prop(space, "use_filter_complete")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-05-03 16:00:42 +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")
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|