Index: source/blender/makesdna/DNA_image_types.h =================================================================== --- source/blender/makesdna/DNA_image_types.h (revision 37143) +++ source/blender/makesdna/DNA_image_types.h (working copy) @@ -58,8 +58,11 @@ short flag; - int pad2; + int pad1; + char usetotframes, pad2, pad3, pad4; + int pad5; + } ImageUser; /* iuser->flag */ Index: source/blender/makesrna/intern/rna_nodetree.c =================================================================== --- source/blender/makesrna/intern/rna_nodetree.c (revision 37143) +++ source/blender/makesrna/intern/rna_nodetree.c (working copy) @@ -1258,7 +1258,12 @@ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); RNA_def_struct_sdna_from(srna, "ImageUser", "storage"); - + + prop = RNA_def_property(srna, "use_total_frames", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "usetotframes", 1); + RNA_def_property_ui_text(prop, "Total Frames", "Sets the total number of frames to total in the movie file"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frames"); RNA_def_property_range(prop, 0, MAXFRAMEF); 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) @@ -510,7 +510,31 @@ if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { col= uiLayoutColumn(layout, 1); - uiItemR(col, ptr, "frame_duration", 0, NULL, ICON_NONE); + + if(source == IMA_SRC_MOVIE) { + uiLayout *moviecol; + + uiItemR(col, ptr, "use_total_frames", 0, NULL, ICON_NONE); + moviecol = uiLayoutColumn(col, 0); + + uiItemR(moviecol, ptr, "frame_duration", 0, NULL, ICON_NONE); + uiLayoutSetActive(moviecol, !(RNA_boolean_get(ptr, "use_total_frames"))); + + if (RNA_boolean_get(ptr, "use_total_frames")) { + Image *ima = imaptr.data; + if(ima->anim) { + ImageUser *iuser= node->storage; + Scene *scene= CTX_data_scene(C); + + iuser->frames = IMB_anim_get_duration(ima->anim); + BKE_image_user_calc_frame(iuser, scene->r.cfra, 0); + } + } + } + + if (source == IMA_SRC_SEQUENCE) { + 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); uiItemR(col, ptr, "use_cyclic", 0, NULL, ICON_NONE);