Index: source/blender/editors/animation/anim_markers.c =================================================================== --- source/blender/editors/animation/anim_markers.c (revision 26987) +++ source/blender/editors/animation/anim_markers.c (working copy) @@ -27,6 +27,7 @@ */ #include +#include #include #include "MEM_guardedalloc.h" @@ -68,6 +69,8 @@ #include "ED_types.h" #include "ED_util.h" +#include "../transform/transform.h" + /* ************* Marker API **************** */ static ListBase *context_get_markers(const bContext *C) @@ -407,6 +410,9 @@ ListBase *markers; int event_type; /* store invoke-event, to verify */ int *oldframe, evtx, firstx; + /* would be best to make this generic */ + NumInput n; + } MarkerMove; /* copy selection to temp buffer */ @@ -437,7 +443,9 @@ a++; } } - + + initNumInput(&mm->n); + mm->n.idx_max= 0; /* one axis */ return 1; } @@ -518,6 +526,8 @@ ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; + case RETKEY: + case PADENTER: case LEFTMOUSE: case MIDDLEMOUSE: case RIGHTMOUSE: @@ -529,6 +539,10 @@ break; case MOUSEMOVE: + + if(hasNumInput(&mm->n)) + break; + dx= v2d->mask.xmax-v2d->mask.xmin; dx= (v2d->cur.xmax-v2d->cur.xmin)/dx; @@ -599,7 +613,31 @@ WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); ED_area_headerprint(CTX_wm_area(C), str); + break; } + case ZEROKEY: case ONEKEY: case TWOKEY: case THREEKEY: case FOURKEY: + case FIVEKEY: case SIXKEY: case SEVENKEY: case EIGHTKEY: case NINEKEY: + case PAD0: case PAD1: case PAD2: case PAD3: case PAD4: case PAD5: + case PAD6: case PAD7: case PAD8: case PAD9: + case PADPERIOD: case BACKSPACEKEY: case MINUSKEY: + if(evt->val==KM_PRESS) { + float vec[3]; + char str_tx[256]; + + handleNumInput(&mm->n, evt, 1.0); + applyNumInput(&mm->n, vec); + outputNumInput(&mm->n, str_tx); + + RNA_int_set(op->ptr, "frames", vec[0]); + ed_marker_move_apply(C, op); + // ed_marker_header_update(C, op, str, (int)vec[0]); + // strcat(str, str_tx); + sprintf(str, "Marker offset %s", str_tx); + ED_area_headerprint(CTX_wm_area(C), str); + + WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); + } + break; } return OPERATOR_RUNNING_MODAL;