== Preview Range ==

Preview Range now works in the IPO editor.
This commit is contained in:
2007-04-06 06:52:00 +00:00
parent 21d1b9e310
commit 29c0708145
6 changed files with 33 additions and 4 deletions

View File

@@ -2162,6 +2162,9 @@ void drawipospace(ScrArea *sa, void *spacedata)
draw_ipohandles(1); draw_ipohandles(1);
draw_ipovertices(1); draw_ipovertices(1);
/* Draw 'curtains' for preview */
draw_anim_preview_timespace();
/* draw markers */ /* draw markers */
draw_markers_timespace(); draw_markers_timespace();

View File

@@ -288,12 +288,24 @@ int get_border(rcti *rect, short flag)
areamouseco_to_ipoco(&sipo->v2d, mval, dvec, dvec+1); areamouseco_to_ipoco(&sipo->v2d, mval, dvec, dvec+1);
areamouseco_to_ipoco(&sipo->v2d, mvalo+2, dvec+2, dvec+3); areamouseco_to_ipoco(&sipo->v2d, mvalo+2, dvec+2, dvec+3);
sprintf(str, "Time: %.4f Y %.4f", dvec[0]-dvec[2], dvec[1]-dvec[3]); if (flag == 5) {
glRasterPos2i(30, 30); /* setting preview range */
if (dvec[0] < dvec[2])
sprintf(str, "Preview Range: %d to %d", (int)dvec[0], (int)dvec[2]);
else
sprintf(str, "Preview Range: %d to %d", (int)dvec[2], (int)dvec[0]);
}
else
sprintf(str, "Time: %.4f Y %.4f", dvec[0]-dvec[2], dvec[1]-dvec[3]);
BIF_ThemeColor(TH_BACK);
glRecti(14, 24, 165, 38);
glColor3f(0.0, 0.0, 0.0); glColor3f(0.0, 0.0, 0.0);
glRasterPos2i(15, 27);
BMF_DrawString(G.fonts, str); BMF_DrawString(G.fonts, str);
glRasterPos2i(31, 31); glColor3f(0.8, 0.8, 0.8);
glColor3f(0.9, 0.9, 0.9); glRasterPos2i(16, 28);
BMF_DrawString(G.fonts, str); BMF_DrawString(G.fonts, str);
} }
else if ((ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME)) && flag==5) { else if ((ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME)) && flag==5) {

View File

@@ -3063,6 +3063,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWACTION, 0); allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
break; break;
case SKEY: case SKEY:

View File

@@ -1928,6 +1928,7 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWACTION, 0); allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
break; break;
case SKEY: case SKEY:

View File

@@ -606,6 +606,7 @@ void anim_previewrange_set()
allqueue(REDRAWTIME, 0); allqueue(REDRAWTIME, 0);
allqueue(REDRAWACTION, 0); allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWBUTSALL, 0); allqueue(REDRAWBUTSALL, 0);
} }
} }

View File

@@ -2753,6 +2753,17 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else else
clean_ipo(); clean_ipo();
break; break;
case PKEY:
if (G.qual & LR_CTRLKEY) /* set preview range */
anim_previewrange_set();
else if (G.qual & LR_ALTKEY) /* clear preview range */
anim_previewrange_clear();
allqueue(REDRAWTIME, 0);
allqueue(REDRAWBUTSALL, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWIPO, 0);
break;
case RKEY: case RKEY:
if (G.qual==0) if (G.qual==0)
ipo_record(); ipo_record();