Movie Clip Editor: cleanup of display panels
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 5 Feb 2012 13:43:58 +0000 (13:43 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 5 Feb 2012 13:43:58 +0000 (13:43 +0000)
- Split display options into two panels:
  * Display, which contains all general display options related on editor itself
  * Marker Display, which contains options which makes sense for markers themselves
   and not used so often.
- Remove Show GPencil option which doesn't actually make sense because strokes might
  be disabled from GPencil panel
- Removed Show Pyramid option and show pyramid for KLT tracker as default.
- Added hotkey to toggle Show Disabled (Alt-D)
- Added hotkey to toggle Show Pattern (Alt-S)

Changes in interface and hotkeys are done by Sebastian Koenig.
 Thanks for the patch!

Own changes in interface were related on Aspect Ratio. It doesn't make
much sense for tracking (camera pixel aspect is what you'll want to use,
but for masking it would make much more sense because when you just
want to create a mask for footage you don't actually have camera).
Just removing from interface seems not so nice for now.

Merged from soc-2011-tomato rev43872

release/scripts/startup/bl_ui/space_clip.py
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/space_clip.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

index 8ebc1c450b4b1dcbb52951f903ad3de6d2a1af25..eb97e5463795e395e80f1d025df5e216a8ea76cf 100644 (file)
@@ -547,23 +547,15 @@ class CLIP_PT_display(Panel):
 
         col = layout.column(align=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")
-
-        col.prop(sc, "show_track_path", text="Path")
-        row = col.row()
-        row.active = sc.show_track_path
-        row.prop(sc, "path_length", text="Length")
-
         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")
@@ -571,15 +563,34 @@ class CLIP_PT_display(Panel):
         elif sc.mode == 'RECONSTRUCTION':
             col.prop(sc, "show_stable", text="Stable")
 
-        col.prop(sc, "lock_selection")
-
-        if sc.view == 'GRAPH':
-            col.prop(sc, "lock_time_cursor")
-
         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_marker_display(Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'UI'
+    bl_label = "Marker Display"
+
+    def draw(self, context):
+        layout = self.layout
+        sc = context.space_data
+
+        col = layout.column(align=True)
+
+        row = col.row()
+        row.prop(sc, "show_marker_pattern", text="Pattern")
+        row.prop(sc, "show_marker_search", text="Search")
+
+        col.prop(sc, "show_tiny_markers", text="Thin Markers")
+        col.prop(sc, "show_track_path", text="Path")
+
+        row = col.row()
+        row.active = sc.show_track_path
+        row.prop(sc, "path_length", text="Length")
 
 
 class CLIP_PT_track_settings(Panel):
index 6c93727bf55394d19c43d70b2ab4460fa9397239..99572345c96539be706ccbf88883691eb18186aa 100644 (file)
@@ -1117,14 +1117,6 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        p->custom_color[1]= 0.0f;
                        p->custom_color[2]= 0.5f;
                        p->custom_color[3]= 0.9f;
-
-                       /* check that gpencil data is allowed to be drawn */
-                       if ((sc->flag & SC_SHOW_GPENCIL)==0) {
-                               p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG)
-                                       printf("Error: In active view, Grease Pencil not shown \n");
-                               return 0;
-                       }
                }
                        break;
 
index a331703690b199a76bf2ead160dc9079118c6d3b..de43b30d4f416a537237ce6f63597716c0aea239 100644 (file)
@@ -586,7 +586,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
        }
 
        /* pyramid */
-       if(sel && TRACK_SELECTED(track) && (sc->flag&SC_SHOW_PYRAMID_LEVELS) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) {
+       if(sel && TRACK_SELECTED(track) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) {
                if(track->flag&TRACK_LOCKED) {
                        if(act) UI_ThemeColor(TH_ACT_MARKER);
                        else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64);
@@ -1307,7 +1307,7 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
        MovieClip *clip= ED_space_clip(sc);
        ImBuf *ibuf;
 
-       if((sc->flag&SC_SHOW_GPENCIL)==0 || !clip)
+       if(!clip)
                return;
 
        if(onlyv2d) {
index 0d34cc2cfbf8d4600962277a67fa2f1ab11b0eab..5abdafbfffc7fd39f4f467124f39aa20f469b76c 100644 (file)
@@ -157,7 +157,7 @@ static SpaceLink *clip_new(const bContext *C)
 
        sc= MEM_callocN(sizeof(SpaceClip), "initclip");
        sc->spacetype= SPACE_CLIP;
-       sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_SHOW_GPENCIL|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES;
+       sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_MANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES;
        sc->zoom= 1.0f;
        sc->path_length= 20;
        sc->scopes.track_preview_height= 120;
@@ -530,6 +530,12 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
        kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection");
 
+       kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.show_disabled");
+
+       kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.show_marker_search");
+
        kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0);
        RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage");
 
index 06138bc075720e79ac6079cbcb8902d57a8f279b..64d858bbcee8d314b444639fa335d79029665864 100644 (file)
@@ -896,11 +896,11 @@ enum {
 #define SC_SHOW_GRID                   (1<<9)
 #define SC_SHOW_STABLE                 (1<<10)
 #define SC_MANUAL_CALIBRATION  (1<<11)
-#define SC_SHOW_GPENCIL                        (1<<12)
+/*#define SC_SHOW_GPENCIL                      (1<<12)*/       /* UNUSED */
 #define SC_SHOW_FILTERS                        (1<<13)
 #define SC_SHOW_GRAPH_FRAMES   (1<<14)
 #define SC_SHOW_GRAPH_TRACKS   (1<<15)
-#define SC_SHOW_PYRAMID_LEVELS (1<<16)
+/*#define SC_SHOW_PYRAMID_LEVELS       (1<<16) */      /* UNUSED */
 #define SC_LOCK_TIMECURSOR             (1<<17)
 
 /* SpaceClip->mode */
index 799366a5234b4c16858dc83cf78887cb025c61fc..8499e2fa111b5fc6ff58e6017fafa7801c746a58 100644 (file)
@@ -2888,12 +2888,6 @@ static void rna_def_space_clip(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH);
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 
-       /* show pyramid */
-       prop= RNA_def_property(srna, "show_pyramid_levels", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_ui_text(prop, "Show Pyramid ", "Show patterns for each pyramid level for markers (KLT only)");
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_PYRAMID_LEVELS);
-       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
-
        /* lock to selection */
        prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback");
@@ -2973,12 +2967,6 @@ static void rna_def_space_clip(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 
-       /* show stable */
-       prop= RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GPENCIL);
-       RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil strokes over the footage");
-       RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
-
        /* show filters */
        prop= RNA_def_property(srna, "show_filters", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_FILTERS);