Movie Clip Editor: cleanup of display panels

- 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
This commit is contained in:
Sergey Sharybin
2012-02-05 13:43:58 +00:00
parent d8d5bb6b9a
commit 04a079668c
6 changed files with 41 additions and 44 deletions

View 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):

View 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;

View 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) {

View 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");

View 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 */

View 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);