Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_outliner.py
| Show All 22 Lines | |||||
| class OUTLINER_HT_header(Header): | class OUTLINER_HT_header(Header): | ||||
| bl_space_type = 'OUTLINER' | bl_space_type = 'OUTLINER' | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| space = context.space_data | space = context.space_data | ||||
| display_mode = space.display_mode | |||||
| scene = context.scene | scene = context.scene | ||||
| ks = context.scene.keying_sets.active | ks = context.scene.keying_sets.active | ||||
| support_filters = display_mode in {'COLLECTIONS', 'ACT_LAYER'} | |||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.template_header() | row.template_header() | ||||
| OUTLINER_MT_editor_menus.draw_collapsible(context, layout) | OUTLINER_MT_editor_menus.draw_collapsible(context, layout) | ||||
| layout.prop(space, "display_mode", text="") | layout.prop(space, "display_mode", text="") | ||||
| if not support_filters: | |||||
| layout.prop(space, "filter_text", icon='VIEWZOOM', text="") | layout.prop(space, "filter_text", icon='VIEWZOOM', text="") | ||||
| layout.separator() | layout.separator() | ||||
| if space.display_mode == 'DATABLOCKS': | if display_mode == 'DATABLOCKS': | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.operator("outliner.keyingset_add_selected", icon='ZOOMIN', text="") | row.operator("outliner.keyingset_add_selected", icon='ZOOMIN', text="") | ||||
| row.operator("outliner.keyingset_remove_selected", icon='ZOOMOUT', text="") | row.operator("outliner.keyingset_remove_selected", icon='ZOOMOUT', text="") | ||||
| if ks: | if ks: | ||||
| row = layout.row() | row = layout.row() | ||||
| row.prop_search(scene.keying_sets, "active", scene, "keying_sets", text="") | row.prop_search(scene.keying_sets, "active", scene, "keying_sets", text="") | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') | row.operator("anim.keyframe_insert", text="", icon='KEY_HLT') | ||||
| row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') | row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') | ||||
| else: | else: | ||||
| row = layout.row() | row = layout.row() | ||||
| row.label(text="No Keying Set Active") | row.label(text="No Keying Set Active") | ||||
| elif space.display_mode == 'ORPHAN_DATA': | elif display_mode == 'ORPHAN_DATA': | ||||
| layout.operator("outliner.orphans_purge") | layout.operator("outliner.orphans_purge") | ||||
| elif space.display_mode == 'ACT_LAYER': | if support_filters: | ||||
| row = layout.row(align=True) | |||||
| row.prop(space, "use_filter_search", text="") | |||||
| if space.use_filter_search: | |||||
| row.prop(space, "filter_text", text="") | |||||
| row.prop(space, "use_sort_alpha", text="", icon='SORTALPHA') | |||||
| row.separator() | |||||
| row.prop(space, "use_filters", text="") | |||||
| if space.use_filters: | |||||
| row.separator() | |||||
| row.prop(space, "use_filter_object", text="") | |||||
| sub = row.row(align=True) | |||||
| sub.active = space.use_filter_object | |||||
| sub.prop(space, "use_filter_object_content", text="") | |||||
| sub.prop(space, "use_filter_children", text="") | |||||
| sub.separator() | |||||
| sub.prop(space, "use_filter_object_type", text="") | |||||
| if space.use_filter_object_type: | |||||
| if bpy.data.meshes: | |||||
| sub.prop(space, "use_filter_object_mesh", text="") | |||||
| if bpy.data.armatures: | |||||
| sub.prop(space, "use_filter_object_armature", text="") | |||||
| if bpy.data.lamps: | |||||
| sub.prop(space, "use_filter_object_lamp", text="") | |||||
| if bpy.data.cameras: | |||||
| sub.prop(space, "use_filter_object_camera", text="") | |||||
| sub.prop(space, "use_filter_object_empty", text="") | |||||
| if bpy.data.curves or \ | |||||
| bpy.data.metaballs or \ | |||||
| bpy.data.lightprobes or \ | |||||
| bpy.data.lattices or \ | |||||
| bpy.data.fonts or bpy.data.speakers: | |||||
| sub.prop(space, "use_filter_object_others", text="") | |||||
| sub.separator() | |||||
| sub.prop(space, "use_filter_object_state", text="") | |||||
| if space.use_filter_object_state: | |||||
| sub.prop(space, "filter_state", text="", expand=True) | |||||
| if display_mode == 'ACT_LAYER': | |||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.operator("outliner.collection_new", text="", icon='NEW') | row.operator("outliner.collection_new", text="", icon='NEW') | ||||
| row.operator("outliner.collection_override_new", text="", icon='LINK_AREA') | row.operator("outliner.collection_override_new", text="", icon='LINK_AREA') | ||||
| row.operator("outliner.collection_link", text="", icon='LINKED') | row.operator("outliner.collection_link", text="", icon='LINKED') | ||||
| row.operator("outliner.collection_unlink", text="", icon='UNLINKED') | row.operator("outliner.collection_unlink", text="", icon='UNLINKED') | ||||
| row.operator("outliner.collections_delete", text="", icon='X') | row.operator("outliner.collections_delete", text="", icon='X') | ||||
| ▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines | |||||