From 4e0aa0e7f23fae72c469262d4aab751fc6d642de Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 5 May 2014 13:59:36 +1200 Subject: NLA Editor: Added dedicated operator for the pushdown operation --- source/blender/editors/animation/anim_channels_defines.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 4a94d044194..746395cfe6f 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3931,17 +3931,18 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale /* NLA Action "pushdown" */ if ((ale->type == ANIMTYPE_NLAACTION) && (ale->adt && ale->adt->action) && !(ale->adt->flag & ADT_NLA_EDIT_ON)) { - //const char *opname = "NLA_OT_action_pushdown"; // XXX: this is the real one - //const char *opname = "NLA_OT_channels_click"; + uiBut *but; + PointerRNA *opptr_b; - // FIXME: this needs to hook up to an operator uiBlockSetEmboss(block, UI_EMBOSS); offset += UI_UNIT_X; - uiDefIconButO(block, BUT, "NLA_OT_channels_click", WM_OP_INVOKE_DEFAULT, ICON_NLA_PUSHDOWN, - (int)v2d->cur.xmax - offset, ymid, UI_UNIT_X, UI_UNIT_X, - "Push action on to the top of the NLA stack as a new NLA Strip"); - // TODO: pass channel index + but = uiDefIconButO(block, BUT, "NLA_OT_action_pushdown", WM_OP_INVOKE_DEFAULT, ICON_NLA_PUSHDOWN, + (int)v2d->cur.xmax - offset, ymid, UI_UNIT_X, UI_UNIT_X, + "Push action on to the top of the NLA stack as a new NLA Strip"); + + opptr_b = uiButGetOperatorPtrRNA(but); + RNA_int_set(opptr_b, "channel_index", channel_index); uiBlockSetEmboss(block, UI_EMBOSSN); } -- cgit v1.2.3