Index: source/blender/editors/space_node/drawnode.c =================================================================== --- source/blender/editors/space_node/drawnode.c (revision 37143) +++ source/blender/editors/space_node/drawnode.c (working copy) @@ -476,6 +476,18 @@ /* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ +static void set_imagenodeframes_cb(bContext *C, void *ima_v, void *iuser_v) +{ + Scene *scene= CTX_data_scene(C); + Image *ima= ima_v; + ImageUser *iuser= iuser_v; + + if(ima->anim) { + iuser->frames = IMB_anim_get_duration(ima->anim); + BKE_image_user_calc_frame(iuser, scene->r.cfra, 0); + } +} + static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiLayout *col; @@ -510,6 +522,18 @@ if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { col= uiLayoutColumn(layout, 1); + + if(source == IMA_SRC_MOVIE) { + ImageUser *iuser= node->storage; + Image *ima= imaptr.data; + uiBlock *block= uiLayoutGetBlock(layout); + uiBut *but; + + but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, + 0, 0, 0, 0, "Set the number of frames to match the movie or sequence."); + uiButSetFunc(but, set_imagenodeframes_cb, ima, iuser); + } + uiItemR(col, ptr, "frame_duration", 0, NULL, ICON_NONE); uiItemR(col, ptr, "frame_start", 0, NULL, ICON_NONE); uiItemR(col, ptr, "frame_offset", 0, NULL, ICON_NONE);