Camera tracking: switch dopesheet information to lazy calculation
[blender.git] / release / scripts / startup / bl_ui / space_clip.py
index af2c6c792b5713c092d17d3f8e58f49882396594..bd3f087e38a686c67cc52e8f121e88615fd73e26 100644 (file)
@@ -16,7 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8 compliant>
+# <pep8-80 compliant>
+
 import bpy
 from bpy.types import Panel, Header, Menu
 
@@ -37,19 +38,20 @@ class CLIP_HT_header(Header):
             sub = row.row(align=True)
             sub.menu("CLIP_MT_view")
 
-            if clip:
-                sub.menu("CLIP_MT_select")
+            if sc.view == 'CLIP':
+                if clip:
+                    sub.menu("CLIP_MT_select")
 
-            sub.menu("CLIP_MT_clip")
+                sub.menu("CLIP_MT_clip")
 
-            if clip:
                 sub.menu("CLIP_MT_track")
                 sub.menu("CLIP_MT_reconstruction")
 
-        if clip:
-            layout.prop(sc, "mode", text="")
-            layout.prop(sc, "view", text="", expand=True)
+        layout.prop(sc, "view", text="", expand=True)
 
+        if clip:
+            if sc.view == 'CLIP':
+                layout.prop(sc, "mode", text="")
             if sc.view == 'GRAPH':
                 row = layout.row(align=True)
 
@@ -70,26 +72,69 @@ class CLIP_HT_header(Header):
         row.template_ID(sc, "clip", open='clip.open')
 
         if clip:
-            r = clip.tracking.reconstruction
+            tracking = clip.tracking
+            active = tracking.objects.active
+
+            if active and not active.is_camera:
+                r = active.reconstruction
+            else:
+                r = tracking.reconstruction
 
-            if r.is_valid:
+            if r.is_valid and sc.view == 'CLIP':
                 layout.label(text="Average solve error: %.4f" %
                     (r.average_error))
 
+            if sc.view == 'DOPESHEET':
+                layout.label(text="Sort by:")
+                layout.prop(sc, "dopesheet_sort_method", text="")
+                layout.prop(sc, "invert_dopesheet_sort", text="Invert")
+
         layout.template_running_jobs()
 
 
-class CLIP_PT_tools_marker(Panel):
-    bl_space_type = 'CLIP_EDITOR'
-    bl_region_type = 'TOOLS'
-    bl_label = "Marker"
+class CLIP_PT_clip_view_panel:
+
+    @classmethod
+    def poll(cls, context):
+        sc = context.space_data
+        clip = sc.clip
+
+        return clip and sc.view == 'CLIP'
+
+class CLIP_PT_tracking_panel:
 
     @classmethod
     def poll(cls, context):
         sc = context.space_data
         clip = sc.clip
 
-        return clip and sc.mode == 'TRACKING'
+        return clip and sc.mode == 'TRACKING' and sc.view == 'CLIP'
+
+
+class CLIP_PT_reconstruction_panel:
+
+    @classmethod
+    def poll(cls, context):
+        sc = context.space_data
+        clip = sc.clip
+
+        return clip and sc.mode == 'RECONSTRUCTION' and sc.view == 'CLIP'
+
+
+class CLIP_PT_distortion_panel:
+
+    @classmethod
+    def poll(cls, context):
+        sc = context.space_data
+        clip = sc.clip
+
+        return clip and sc.mode == 'DISTORTION' and sc.view == 'CLIP'
+
+
+class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Marker"
 
     def draw(self, context):
         sc = context.space_data
@@ -110,16 +155,26 @@ class CLIP_PT_tools_marker(Panel):
         if settings.show_default_expanded:
             col = box.column()
             row = col.row(align=True)
-            label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label
+            label = CLIP_MT_tracking_settings_presets.bl_label
             row.menu('CLIP_MT_tracking_settings_presets', text=label)
             row.operator("clip.tracking_settings_preset_add",
                          text="", icon='ZOOMIN')
-            props = row.operator("clip.track_color_preset_add",
+            props = row.operator("clip.tracking_settings_preset_add",
                                  text="", icon='ZOOMOUT')
             props.remove_active = True
 
             col.separator()
 
+            row = col.row(align=True)
+            row.prop(settings, "use_default_red_channel",
+                     text="R", toggle=True)
+            row.prop(settings, "use_default_green_channel",
+                     text="G", toggle=True)
+            row.prop(settings, "use_default_blue_channel",
+                     text="B", toggle=True)
+
+            col.separator()
+
             sub = col.column(align=True)
             sub.prop(settings, "default_pattern_size")
             sub.prop(settings, "default_search_size")
@@ -129,8 +184,7 @@ class CLIP_PT_tools_marker(Panel):
 
             if settings.default_tracker == 'KLT':
                 col.prop(settings, "default_pyramid_levels")
-            elif settings.default_tracker == 'SAD':
-                col.prop(settings, "default_correlation_min")
+            col.prop(settings, "default_correlation_min")
 
             col.separator()
 
@@ -141,32 +195,29 @@ class CLIP_PT_tools_marker(Panel):
             col.label(text="Match:")
             col.prop(settings, "default_pattern_match", text="")
 
+            col.separator()
+            col.operator('clip.track_settings_as_default',
+                         text="Copy From Active Track")
+
 
-class CLIP_PT_tools_tracking(Panel):
+class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Track"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'TRACKING'
-
     def draw(self, context):
         layout = self.layout
-        # clip = context.space_data.clip  # UNUSED
 
         row = layout.row(align=True)
 
         props = row.operator("clip.track_markers", text="", icon='FRAME_PREV')
         props.backwards = True
         props = row.operator("clip.track_markers", text="",
-             icon='PLAY_REVERSE')
+                             icon='PLAY_REVERSE')
         props.backwards = True
         props.sequence = True
         props = row.operator("clip.track_markers", text="", icon='PLAY')
+        props.backwards = False
         props.sequence = True
         row.operator("clip.track_markers", text="", icon='FRAME_NEXT')
 
@@ -176,55 +227,49 @@ class CLIP_PT_tools_tracking(Panel):
 
         props = col.operator("clip.clear_track_path", text="Clear Before")
         props.action = 'UPTO'
-
-        props = col.operator("clip.clear_track_path", text="Clear")
-        props.action = 'ALL'
+        col.operator("clip.clear_track_path", text="Clear").action = 'ALL'
 
         layout.operator("clip.join_tracks", text="Join")
 
 
-class CLIP_PT_tools_solve(Panel):
+class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Solve"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'TRACKING'
-
     def draw(self, context):
         layout = self.layout
         clip = context.space_data.clip
-        settings = clip.tracking.settings
+        tracking = clip.tracking
+        settings = tracking.settings
+        tracking_object = tracking.objects.active
 
         col = layout.column(align=True)
-        col.operator("clip.solve_camera", text="Camera Motion")
+
+        col.operator("clip.solve_camera",
+                     text="Camera Motion" if tracking_object.is_camera
+                     else "Object Motion")
         col.operator("clip.clear_solution")
 
+        col = layout.column()
+        col.prop(settings, "use_tripod_solver")
+
         col = layout.column(align=True)
+        col.active = not settings.use_tripod_solver
         col.prop(settings, "keyframe_a")
         col.prop(settings, "keyframe_b")
 
         col = layout.column(align=True)
+        col.active = tracking_object.is_camera and not settings.use_tripod_solver
         col.label(text="Refine:")
         col.prop(settings, "refine_intrinsics", text="")
 
 
-class CLIP_PT_tools_cleanup(Panel):
+class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Clean up"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'TRACKING'
-
     def draw(self, context):
         layout = self.layout
         clip = context.space_data.clip
@@ -237,18 +282,11 @@ class CLIP_PT_tools_cleanup(Panel):
         layout.prop(settings, 'clean_action', text="")
 
 
-class CLIP_PT_tools_geometry(Panel):
+class CLIP_PT_tools_geometry(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Geometry"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'RECONSTRUCTION'
-
     def draw(self, context):
         layout = self.layout
 
@@ -256,25 +294,22 @@ class CLIP_PT_tools_geometry(Panel):
         layout.operator("clip.track_to_empty")
 
 
-class CLIP_PT_tools_orientation(Panel):
+class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Orientation"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'RECONSTRUCTION'
-
     def draw(self, context):
         sc = context.space_data
         layout = self.layout
         settings = sc.clip.tracking.settings
 
         col = layout.column(align=True)
-        col.operator("clip.set_floor")
+        row = col.row()
+        props = row.operator("clip.set_plane", text="Floor")
+        props.plane = 'FLOOR'
+        props = row.operator("clip.set_plane", text="Wall")
+        props.plane = 'WALL'
         col.operator("clip.set_origin")
 
         row = col.row()
@@ -288,17 +323,45 @@ class CLIP_PT_tools_orientation(Panel):
         col.prop(settings, "distance")
 
 
-class CLIP_PT_tools_grease_pencil(Panel):
+class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
-    bl_label = "Grease Pencil"
+    bl_label = "Object"
 
     @classmethod
     def poll(cls, context):
+        if CLIP_PT_reconstruction_panel.poll(context):
+            sc = context.space_data
+            clip = sc.clip
+
+            tracking_object = clip.tracking.objects.active
+
+            return not tracking_object.is_camera
+
+        return False
+
+    def draw(self, context):
+        layout = self.layout
+
         sc = context.space_data
         clip = sc.clip
+        tracking_object = clip.tracking.objects.active
+        settings = sc.clip.tracking.settings
+
+        col = layout.column()
+
+        col.prop(tracking_object, "scale")
+
+        col.separator()
 
-        return clip and sc.mode == 'DISTORTION'
+        col.operator("clip.set_solution_scale", text="Set Scale")
+        col.prop(settings, "object_distance")
+
+
+class CLIP_PT_tools_grease_pencil(CLIP_PT_distortion_panel, Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Grease Pencil"
 
     def draw(self, context):
         layout = self.layout
@@ -317,17 +380,36 @@ class CLIP_PT_tools_grease_pencil(Panel):
         row.prop(context.tool_settings, "use_grease_pencil_sessions")
 
 
-class CLIP_PT_track(Panel):
+class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
-    bl_label = "Track"
+    bl_label = "Objects"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
 
-    @classmethod
-    def poll(cls, context):
         sc = context.space_data
-        clip = sc.clip
+        tracking = sc.clip.tracking
+
+        row = layout.row()
+        row.template_list(tracking, "objects",
+                          tracking, "active_object_index", rows=3)
+
+        sub = row.column(align=True)
+
+        sub.operator("clip.tracking_object_new", icon='ZOOMIN', text="")
+        sub.operator("clip.tracking_object_remove", icon='ZOOMOUT', text="")
+
+        active = tracking.objects.active
+        if active:
+            layout.prop(active, "name")
+
 
-        return sc.mode == 'TRACKING' and clip
+class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'UI'
+    bl_label = "Track"
 
     def draw(self, context):
         layout = self.layout
@@ -353,9 +435,15 @@ class CLIP_PT_track(Panel):
         layout.template_track(sc, "scopes")
 
         row = layout.row(align=True)
-        row.prop(act_track, "use_red_channel", text="R", toggle=True)
-        row.prop(act_track, "use_green_channel", text="G", toggle=True)
-        row.prop(act_track, "use_blue_channel", text="B", toggle=True)
+        sub = row.row()
+        sub.prop(act_track, "use_red_channel", text="R", toggle=True)
+        sub.prop(act_track, "use_green_channel", text="G", toggle=True)
+        sub.prop(act_track, "use_blue_channel", text="B", toggle=True)
+
+        row.separator()
+
+        sub = row.row()
+        sub.prop(act_track, "use_grayscale_preview", text="B/W", toggle=True)
 
         layout.separator()
 
@@ -378,6 +466,35 @@ class CLIP_PT_track(Panel):
             layout.label(text=label_text)
 
 
+class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'UI'
+    bl_label = "Tracking Settings"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+        clip = context.space_data.clip
+        settings = clip.tracking.settings
+
+        col = layout.column()
+
+        active = clip.tracking.tracks.active
+        if active:
+            col.prop(active, "tracker")
+
+            if active.tracker == 'KLT':
+                col.prop(active, "pyramid_levels")
+            col.prop(active, "correlation_min")
+
+            col.separator()
+            col.prop(active, "frames_limit")
+            col.prop(active, "margin")
+            col.prop(active, "pattern_match", text="Match")
+
+        col.prop(settings, "speed")
+
+
 class CLIP_PT_tracking_camera(Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
@@ -386,9 +503,12 @@ class CLIP_PT_tracking_camera(Panel):
 
     @classmethod
     def poll(cls, context):
-        sc = context.space_data
+        if CLIP_PT_clip_view_panel.poll(context):
+            sc = context.space_data
 
-        return sc.mode in ['TRACKING', 'DISTORTION'] and sc.clip
+            return sc.mode in {'TRACKING', 'DISTORTION'} and sc.clip
+
+        return False
 
     def draw(self, context):
         layout = self.layout
@@ -423,13 +543,13 @@ class CLIP_PT_tracking_camera(Panel):
         col.operator("clip.set_center_principal", text="Center")
 
         col = layout.column(align=True)
-        col.label(text="Undistortion:")
+        col.label(text="Lens Distortion:")
         col.prop(clip.tracking.camera, "k1")
         col.prop(clip.tracking.camera, "k2")
         col.prop(clip.tracking.camera, "k3")
 
 
-class CLIP_PT_display(Panel):
+class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Display"
@@ -438,25 +558,28 @@ class CLIP_PT_display(Panel):
         layout = self.layout
         sc = context.space_data
 
-        col = layout.column(align=True)
+        row = layout.row(align=True)
+        sub = row.row()
+        sub.prop(sc, "show_red_channel", text="R", toggle=True)
+        sub.prop(sc, "show_green_channel", text="G", toggle=True)
+        sub.prop(sc, "show_blue_channel", text="B", toggle=True)
 
-        col.prop(sc, "show_marker_pattern", text="Pattern")
-        col.prop(sc, "show_marker_search", text="Search")
-        col.prop(sc, "show_pyramid_levels", text="Pyramid")
+        row.separator()
 
-        col.prop(sc, "show_track_path", text="Path")
-        row = col.row()
-        row.active = sc.show_track_path
-        row.prop(sc, "path_length", text="Length")
+        sub = row.row()
+        sub.prop(sc, "use_grayscale_preview", text="B/W", toggle=True)
+
+        col = layout.column(align=True)
 
         col.prop(sc, "show_disabled", "Disabled Tracks")
+        col.prop(sc, "show_names", text="Names and Status")
         col.prop(sc, "show_bundles", text="3D Markers")
 
-        col.prop(sc, "show_names", text="Names and Status")
-        col.prop(sc, "show_tiny_markers", text="Compact Markers")
+        col.prop(sc, "use_mute_footage", text="Mute Footage")
+        col.prop(sc, "lock_selection")
 
-        col.prop(sc, "show_grease_pencil", text="Grease Pencil")
-        col.prop(sc, "use_mute_footage", text="Mute")
+        if sc.view == 'GRAPH':
+            col.prop(sc, "lock_time_cursor")
 
         if sc.mode == 'DISTORTION':
             col.prop(sc, "show_grid", text="Grid")
@@ -464,62 +587,42 @@ class CLIP_PT_display(Panel):
         elif sc.mode == 'RECONSTRUCTION':
             col.prop(sc, "show_stable", text="Stable")
 
-        col.prop(sc, "lock_selection")
-
         clip = sc.clip
         if clip:
             col.label(text="Display Aspect Ratio:")
-            col.prop(clip, "display_aspect", text="")
+            row = col.row()
+            row.prop(clip, "display_aspect", text="")
 
 
-class CLIP_PT_track_settings(Panel):
+class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
-    bl_label = "Tracking Settings"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.mode == 'TRACKING' and sc.clip
+    bl_label = "Marker Display"
 
     def draw(self, context):
         layout = self.layout
-        clip = context.space_data.clip
-        settings = clip.tracking.settings
-
-        col = layout.column()
+        sc = context.space_data
 
-        active = clip.tracking.tracks.active
-        if active:
-            col.prop(active, "tracker")
+        col = layout.column(align=True)
 
-            if active.tracker == 'KLT':
-                col.prop(active, "pyramid_levels")
-            elif active.tracker == 'SAD':
-                col.prop(active, "correlation_min")
+        row = col.row()
+        row.prop(sc, "show_marker_pattern", text="Pattern")
+        row.prop(sc, "show_marker_search", text="Search")
 
-            col.separator()
-            col.prop(active, "frames_limit")
-            col.prop(active, "margin")
-            col.prop(active, "pattern_match", text="Match")
+        col.prop(sc, "show_tiny_markers", text="Thin Markers")
+        col.prop(sc, "show_track_path", text="Path")
 
-        col.prop(settings, "speed")
+        row = col.row()
+        row.active = sc.show_track_path
+        row.prop(sc, "path_length", text="Length")
 
 
-class CLIP_PT_stabilization(Panel):
+class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "2D Stabilization"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.mode == 'RECONSTRUCTION' and sc.clip
-
     def draw_header(self, context):
         stab = context.space_data.clip.tracking.stabilization
 
@@ -564,20 +667,15 @@ class CLIP_PT_stabilization(Panel):
         row.active = stab.rotation_track is not None
         row.prop(stab, "influence_rotation")
 
+        layout.prop(stab, "filter_type")
 
-class CLIP_PT_marker(Panel):
+
+class CLIP_PT_marker(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Marker"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return sc.mode == 'TRACKING' and clip
-
     def draw(self, context):
         layout = self.layout
         sc = context.space_data
@@ -591,18 +689,12 @@ class CLIP_PT_marker(Panel):
             layout.label(text="No active track")
 
 
-class CLIP_PT_proxy(Panel):
+class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Proxy / Timecode"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.clip
-
     def draw_header(self, context):
         sc = context.space_data
 
@@ -615,17 +707,21 @@ class CLIP_PT_proxy(Panel):
 
         layout.active = clip.use_proxy
 
-        layout.label(text="Build Sizes:")
+        layout.label(text="Build Original:")
 
-        row = layout.row()
-        row.prop(clip.proxy, "build_25")
-        row.prop(clip.proxy, "build_50")
+        row = layout.row(align=True)
+        row.prop(clip.proxy, "build_25", toggle=True)
+        row.prop(clip.proxy, "build_50", toggle=True)
+        row.prop(clip.proxy, "build_75", toggle=True)
+        row.prop(clip.proxy, "build_100", toggle=True)
 
-        row = layout.row()
-        row.prop(clip.proxy, "build_75")
-        row.prop(clip.proxy, "build_100")
+        layout.label(text="Build Undistorted:")
 
-        layout.prop(clip.proxy, "build_undistorted")
+        row = layout.row(align=True)
+        row.prop(clip.proxy, "build_undistorted_25", toggle=True)
+        row.prop(clip.proxy, "build_undistorted_50", toggle=True)
+        row.prop(clip.proxy, "build_undistorted_75", toggle=True)
+        row.prop(clip.proxy, "build_undistorted_100", toggle=True)
 
         layout.prop(clip.proxy, "quality")
 
@@ -633,7 +729,7 @@ class CLIP_PT_proxy(Panel):
         if clip.use_proxy_custom_directory:
             layout.prop(clip.proxy, "directory")
 
-        layout.operator("clip.rebuild_proxy", text="Rebuild Proxy")
+        layout.operator("clip.rebuild_proxy", text="Build Proxy")
 
         if clip.source == 'MOVIE':
             col = layout.column()
@@ -648,18 +744,12 @@ class CLIP_PT_proxy(Panel):
         col.prop(sc.clip_user, "use_render_undistorted")
 
 
-class CLIP_PT_footage(Panel):
+class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Footage Settings"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.clip
-
     def draw(self, context):
         layout = self.layout
 
@@ -672,17 +762,11 @@ class CLIP_PT_footage(Panel):
             layout.operator("clip.open", icon='FILESEL')
 
 
-class CLIP_PT_tools_clip(Panel):
+class CLIP_PT_tools_clip(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Clip"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.clip
-
     def draw(self, context):
         layout = self.layout
 
@@ -695,25 +779,30 @@ class CLIP_MT_view(Menu):
 
     def draw(self, context):
         layout = self.layout
+        sc = context.space_data
 
-        layout.operator("clip.properties", icon='MENU_PANEL')
-        layout.operator("clip.tools", icon='MENU_PANEL')
-        layout.separator()
+        if sc.view == 'CLIP':
+            layout.operator("clip.properties", icon='MENU_PANEL')
+            layout.operator("clip.tools", icon='MENU_PANEL')
+            layout.separator()
 
-        layout.operator("clip.view_selected")
-        layout.operator("clip.view_all")
+            layout.operator("clip.view_selected")
+            layout.operator("clip.view_all")
 
-        layout.separator()
-        layout.operator("clip.view_zoom_in")
-        layout.operator("clip.view_zoom_out")
+            layout.separator()
+            layout.operator("clip.view_zoom_in")
+            layout.operator("clip.view_zoom_out")
 
-        layout.separator()
+            layout.separator()
 
-        ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
+            ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
-        for a, b in ratios:
-            text = "Zoom %d:%d" % (a, b)
-            layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b
+            for a, b in ratios:
+                text = "Zoom %d:%d" % (a, b)
+                layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b
+        else:
+            layout.prop(sc, "show_seconds")
+            layout.separator()
 
         layout.separator()
         layout.operator("screen.area_dupli")
@@ -772,6 +861,10 @@ class CLIP_MT_track(Menu):
         layout.separator()
         layout.operator("clip.clean_tracks")
 
+        layout.separator()
+        layout.operator("clip.copy_tracks")
+        layout.operator("clip.paste_tracks")
+
         layout.separator()
         props = layout.operator("clip.track_markers",
             text="Track Frame Backwards")
@@ -804,7 +897,10 @@ class CLIP_MT_reconstruction(Menu):
         layout = self.layout
 
         layout.operator("clip.set_origin")
-        layout.operator("clip.set_floor")
+        props = layout.operator("clip.set_plane", text="Set Floor")
+        props.plane = 'FLOOR'
+        props = layout.operator("clip.set_plane", text="Set Wall")
+        props.plane = 'WALL'
 
         layout.operator("clip.set_axis", text="Set X Axis").axis = "X"
         layout.operator("clip.set_axis", text="Set Y Axis").axis = "Y"
@@ -851,7 +947,7 @@ class CLIP_MT_select(Menu):
 
         layout.separator()
 
-        layout.operator("clip.select_all", text="Select/Deselect all")
+        layout.operator("clip.select_all").action = 'TOGGLE'
         layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
 
         layout.menu("CLIP_MT_select_grouped")
@@ -876,7 +972,8 @@ class CLIP_MT_tracking_specials(Menu):
     def draw(self, context):
         layout = self.layout
 
-        props = layout.operator("clip.disable_markers", text="Enable Markers")
+        props = layout.operator("clip.disable_markers",
+                                text="Enable Markers")
         props.action = 'ENABLE'
 
         props = layout.operator("clip.disable_markers", text="Disable markers")
@@ -902,7 +999,7 @@ class CLIP_MT_camera_presets(Menu):
     bl_label = "Camera Presets"
     preset_subdir = "tracking_camera"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_track_color_presets(Menu):
@@ -910,7 +1007,7 @@ class CLIP_MT_track_color_presets(Menu):
     bl_label = "Color Presets"
     preset_subdir = "tracking_track_color"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_tracking_settings_presets(Menu):
@@ -918,7 +1015,7 @@ class CLIP_MT_tracking_settings_presets(Menu):
     bl_label = "Tracking Presets"
     preset_subdir = "tracking_settings"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_track_color_specials(Menu):