Correction recent start/end range values for frames: it was impossible to set

start frame = end frame which is useful in some cases.

Also made behavior of S/E operators equal to sliders in timeline.
This commit is contained in:
Sergey Sharybin 2012-03-22 17:27:37 +00:00
parent a4ffb69e3a
commit 665f784b06
3 changed files with 19 additions and 14 deletions

@ -56,10 +56,6 @@ static int time_set_sfra_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
frame= CFRA;
/* if 'end frame' (Preview Range or Actual) is less than 'frame',
* clamp 'frame' to 'end frame'
*/
if (PEFRA < frame) frame= PEFRA;
/* if Preview Range is defined, set the 'start' frame for that */
if (PRVRANGEON)
@ -67,6 +63,13 @@ static int time_set_sfra_exec (bContext *C, wmOperator *UNUSED(op))
else
scene->r.sfra= frame;
if (PEFRA < frame) {
if (PRVRANGEON)
scene->r.pefra= frame;
else
scene->r.efra= frame;
}
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
return OPERATOR_FINISHED;
@ -98,17 +101,19 @@ static int time_set_efra_exec (bContext *C, wmOperator *UNUSED(op))
frame= CFRA;
/* if 'start frame' (Preview Range or Actual) is greater than 'frame',
* clamp 'frame' to 'end frame'
*/
if (PSFRA > frame) frame= PSFRA;
/* if Preview Range is defined, set the 'end' frame for that */
if (PRVRANGEON)
scene->r.pefra= frame;
else
scene->r.efra= frame;
if (PSFRA > frame) {
if (PRVRANGEON)
scene->r.psfra= frame;
else
scene->r.sfra= frame;
}
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
return OPERATOR_FINISHED;

@ -238,7 +238,7 @@ static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value)
data->ghostsf = value;
if (data->ghostsf >= data->ghostef) {
data->ghostef = MIN2(data->ghostsf + 1, (int)(MAXFRAMEF/2));
data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF/2));
}
}
@ -249,7 +249,7 @@ static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value)
data->ghostef = value;
if (data->ghostsf >= data->ghostef) {
data->ghostsf = MAX2(data->ghostef - 1, 1);
data->ghostsf = MAX2(data->ghostef, 1);
}
}
/* XXX depreceated... old armature only animviz */

@ -487,7 +487,7 @@ static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
data->r.sfra = value;
if (data->r.sfra >= data->r.efra) {
data->r.efra = MIN2(data->r.sfra + 1, MAXFRAME);
data->r.efra = MIN2(data->r.sfra, MAXFRAME);
}
}
@ -498,7 +498,7 @@ static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
data->r.efra = value;
if (data->r.sfra >= data->r.efra) {
data->r.sfra = MAX2(data->r.efra - 1, MINFRAME);
data->r.sfra = MAX2(data->r.efra, MINFRAME);
}
}