Merging r43501 through r43720 form trunk into soc-2011-tomato
[blender.git] / release / scripts / startup / bl_ui / space_dopesheet.py
index 74ae427c5cf34cae099186f3bbe640a7f79c7688..b7d69fb38b339e7420e74f9297df0b8a1888cfce 100644 (file)
@@ -36,7 +36,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 
     if is_nla:
         row.prop(dopesheet, "show_missing_nla", text="")
-    
+
     if not genericFiltersOnly:
         if bpy.data.groups:
             row = layout.row(align=True)
@@ -50,40 +50,41 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
         if dopesheet.show_only_matching_fcurves:
             row.prop(dopesheet, "filter_fcurve_name", text="")
 
-    row = layout.row(align=True)
-    row.prop(dopesheet, "show_datablock_filters", text="Filters")
-
-    if (not genericFiltersOnly) and (dopesheet.show_datablock_filters):
-        row.prop(dopesheet, "show_scenes", text="")
-        row.prop(dopesheet, "show_worlds", text="")
-        row.prop(dopesheet, "show_nodes", text="")
-
-        row.prop(dopesheet, "show_transforms", text="")
-
-        if bpy.data.meshes:
-            row.prop(dopesheet, "show_meshes", text="")
-        if bpy.data.shape_keys:
-            row.prop(dopesheet, "show_shapekeys", text="")
-        if bpy.data.materials:
-            row.prop(dopesheet, "show_materials", text="")
-        if bpy.data.lamps:
-            row.prop(dopesheet, "show_lamps", text="")
-        if bpy.data.textures:
-            row.prop(dopesheet, "show_textures", text="")
-        if bpy.data.cameras:
-            row.prop(dopesheet, "show_cameras", text="")
-        if bpy.data.curves:
-            row.prop(dopesheet, "show_curves", text="")
-        if bpy.data.metaballs:
-            row.prop(dopesheet, "show_metaballs", text="")
-        if bpy.data.lattices:
-            row.prop(dopesheet, "show_lattices", text="")
-        if bpy.data.armatures:
-            row.prop(dopesheet, "show_armatures", text="")
-        if bpy.data.particles:
-            row.prop(dopesheet, "show_particles", text="")
-        if bpy.data.speakers:
-            row.prop(dopesheet, "show_speakers", text="")
+    if not genericFiltersOnly:
+        row = layout.row(align=True)
+        row.prop(dopesheet, "show_datablock_filters", text="Filters")
+
+        if dopesheet.show_datablock_filters:
+            row.prop(dopesheet, "show_scenes", text="")
+            row.prop(dopesheet, "show_worlds", text="")
+            row.prop(dopesheet, "show_nodes", text="")
+
+            row.prop(dopesheet, "show_transforms", text="")
+
+            if bpy.data.meshes:
+                row.prop(dopesheet, "show_meshes", text="")
+            if bpy.data.shape_keys:
+                row.prop(dopesheet, "show_shapekeys", text="")
+            if bpy.data.materials:
+                row.prop(dopesheet, "show_materials", text="")
+            if bpy.data.lamps:
+                row.prop(dopesheet, "show_lamps", text="")
+            if bpy.data.textures:
+                row.prop(dopesheet, "show_textures", text="")
+            if bpy.data.cameras:
+                row.prop(dopesheet, "show_cameras", text="")
+            if bpy.data.curves:
+                row.prop(dopesheet, "show_curves", text="")
+            if bpy.data.metaballs:
+                row.prop(dopesheet, "show_metaballs", text="")
+            if bpy.data.lattices:
+                row.prop(dopesheet, "show_lattices", text="")
+            if bpy.data.armatures:
+                row.prop(dopesheet, "show_armatures", text="")
+            if bpy.data.particles:
+                row.prop(dopesheet, "show_particles", text="")
+            if bpy.data.speakers:
+                row.prop(dopesheet, "show_speakers", text="")
 
 
 #######################################
@@ -105,7 +106,7 @@ class DOPESHEET_HT_header(Header):
             row.menu("DOPESHEET_MT_select")
             row.menu("DOPESHEET_MT_marker")
 
-            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
+            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
                 row.menu("DOPESHEET_MT_channel")
             elif st.mode == 'GPENCIL':
                 row.menu("DOPESHEET_MT_gpencil_channel")
@@ -151,10 +152,7 @@ class DOPESHEET_MT_view(Menu):
         layout.prop(st, "use_auto_merge_keyframes")
         layout.prop(st, "use_marker_sync")
 
-        if st.show_seconds:
-            layout.operator("anim.time_toggle", text="Show Frames")
-        else:
-            layout.operator("anim.time_toggle", text="Show Seconds")
+        layout.prop(st, "show_seconds")
 
         layout.separator()
         layout.operator("anim.previewrange_set")
@@ -178,11 +176,11 @@ class DOPESHEET_MT_select(Menu):
         layout = self.layout
 
         # This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
-        layout.operator("action.select_all_toggle")
+        layout.operator("action.select_all_toggle").invert = False
         layout.operator("action.select_all_toggle", text="Invert Selection").invert = True
 
         layout.separator()
-        layout.operator("action.select_border")
+        layout.operator("action.select_border").axis_range = False
         layout.operator("action.select_border", text="Border Axis Range").axis_range = True
 
         layout.separator()
@@ -212,18 +210,10 @@ class DOPESHEET_MT_marker(Menu):
     def draw(self, context):
         layout = self.layout
 
-        st = context.space_data
-
-        #layout.operator_context = 'EXEC_REGION_WIN'
-
-        layout.operator("marker.add", "Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
+        from .space_time import marker_menu_generic
+        marker_menu_generic(layout)
 
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
+        st = context.space_data
 
         if st.mode in {'ACTION', 'SHAPEKEY'} and st.action:
             layout.separator()