[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46123] trunk/blender: Camera tracking: initial commit of dopesheet view for clip editor

Sergey Sharybin sergey.vfx at gmail.com
Mon Apr 30 18:19:20 CEST 2012


Revision: 46123
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46123
Author:   nazgul
Date:     2012-04-30 16:19:20 +0000 (Mon, 30 Apr 2012)
Log Message:
-----------
Camera tracking: initial commit of dopesheet view for clip editor

- Displays dopesheet information for selected tracks, and currently does not
  support any kind of editing.
- Changed regions to use the whole main region for such views as curves and dopesheet.
  This allows to have own panels with tools/properties in this area.
- Active clip is getting synchronized between different clip editor editors in the
  same screen, so updating of curve/dopesheet views happens automatically when one
  changes current clip in one of this editors.
- Panels in toolbox and properties panels are now separated to rely on current view
  mode, but some operators and poll functions still need to be updated.
- Added new screen called "Movie Tracking" where layout is configured to
  display timeline, main clip window, curves and dopesheet.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/source/blender/blenkernel/BKE_blender.h
    trunk/blender/source/blender/blenkernel/BKE_tracking.h
    trunk/blender/source/blender/blenkernel/intern/movieclip.c
    trunk/blender/source/blender/blenkernel/intern/tracking.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/blenloader/intern/writefile.c
    trunk/blender/source/blender/editors/datafiles/startup.blend.c
    trunk/blender/source/blender/editors/include/ED_clip.h
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/space_clip/CMakeLists.txt
    trunk/blender/source/blender/editors/space_clip/clip_buttons.c
    trunk/blender/source/blender/editors/space_clip/clip_editor.c
    trunk/blender/source/blender/editors/space_clip/clip_graph_ops.c
    trunk/blender/source/blender/editors/space_clip/clip_intern.h
    trunk/blender/source/blender/editors/space_clip/clip_ops.c
    trunk/blender/source/blender/editors/space_clip/space_clip.c
    trunk/blender/source/blender/editors/space_clip/tracking_ops.c
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/makesdna/DNA_tracking_types.h
    trunk/blender/source/blender/makesrna/RNA_access.h
    trunk/blender/source/blender/makesrna/intern/rna_space.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Added Paths:
-----------
    trunk/blender/source/blender/editors/space_clip/clip_dopesheet_draw.c
    trunk/blender/source/blender/editors/space_clip/clip_dopesheet_ops.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2012-04-30 16:19:12 UTC (rev 46122)
+++ trunk/blender/release/scripts/startup/bl_ui/space_clip.py	2012-04-30 16:19:20 UTC (rev 46123)
@@ -38,19 +38,20 @@
             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)
 
@@ -79,25 +80,57 @@
             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))
 
         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.mode == 'TRACKING'
+        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' 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
         clip = sc.clip
@@ -162,18 +195,11 @@
                          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
 
@@ -201,18 +227,11 @@
         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
@@ -241,18 +260,11 @@
         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
@@ -265,18 +277,11 @@
         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
 
@@ -284,18 +289,11 @@
         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
@@ -320,18 +318,19 @@
         col.prop(settings, "distance")
 
 
-class CLIP_PT_tools_object(Panel):
+class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Object"
 
     @classmethod
     def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
+        if CLIP_PT_reconstruction_panel.poll(context):
+            sc = context.space_data
+            clip = sc.clip
 
-        if clip and sc.mode == 'RECONSTRUCTION':
             tracking_object = clip.tracking.objects.active
+
             return not tracking_object.is_camera
 
         return False
@@ -354,18 +353,11 @@
         col.prop(settings, "object_distance")
 
 
-class CLIP_PT_tools_grease_pencil(Panel):
+class CLIP_PT_tools_grease_pencil(CLIP_PT_distortion_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'TOOLS'
     bl_label = "Grease Pencil"
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        clip = sc.clip
-
-        return clip and sc.mode == 'DISTORTION'
-
     def draw(self, context):
         layout = self.layout
 
@@ -383,18 +375,12 @@
         row.prop(context.tool_settings, "use_grease_pencil_sessions")
 
 
-class CLIP_PT_objects(Panel):
+class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Objects"
     bl_options = {'DEFAULT_CLOSED'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.clip
-
     def draw(self, context):
         layout = self.layout
 
@@ -415,18 +401,11 @@
             layout.prop(active, "name")
 
 
-class CLIP_PT_track(Panel):
+class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Track"
 
-    @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
@@ -482,18 +461,12 @@
             layout.label(text=label_text)
 
 
-class CLIP_PT_track_settings(Panel):
+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'}
 
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-
-        return sc.mode == 'TRACKING' and sc.clip
-
     def draw(self, context):
         layout = self.layout
         clip = context.space_data.clip
@@ -525,10 +498,13 @@
 
     @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
 
@@ -568,7 +544,7 @@
         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"
@@ -613,7 +589,7 @@
             row.prop(clip, "display_aspect", text="")
 
 
-class CLIP_PT_marker_display(Panel):
+class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Marker Display"
@@ -636,18 +612,12 @@
         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
 
@@ -695,19 +665,12 @@
         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
@@ -721,18 +684,12 @@
             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
 
@@ -782,18 +739,12 @@
         col.prop(sc.clip_user, "use_render_undistorted")
 
 
-class CLIP_PT_footage(Panel):

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list