From 761241fcbbeb254cd78aca5f8bb62330ce9369ac Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 06:56:29 +0000 Subject: NLA SoC: Current Frame can now be negative This commit is quite experimental, and might have to be reverted, but in quite a few places, the cleanups from this commit were already necessary. * I've left most of the image-handling functions alone, since I'm not sure how well they cope with negative indices. * Start/End frames cannot be negative for now... any specific reasons why they should be negative? --- source/blender/editors/animation/anim_ops.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/animation/anim_ops.c') diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index e899cc1d520..10691c558bf 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -83,10 +83,12 @@ static void change_frame_apply(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); int cfra; - /* get frame, and clamp to MINFRAME */ + /* get frame, and clamp to MINAFRAME + * - not MINFRAME, since it's useful to be able to key a few-frames back + */ cfra= RNA_int_get(op->ptr, "frame"); - if (cfra < MINFRAME) cfra= MINFRAME; + if (cfra < MINAFRAME) cfra= MINAFRAME; CFRA= cfra; WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); @@ -209,7 +211,7 @@ void ANIM_OT_change_frame(wmOperatorType *ot) ot->modal= change_frame_modal; /* rna */ - RNA_def_int(ot->srna, "frame", 0, 1, MAXFRAME, "Frame", "", 1, MAXFRAME); + RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); } /* ****************** set preview range operator ****************************/ -- cgit v1.2.3