diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-01 18:02:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-01 18:02:40 +0400 |
commit | 5440b57432b43207e42817fe4dcce1716151ef3c (patch) | |
tree | 9c7be6875720b78a38b5b97602a7ac2cfc88ac5b /source/blender/editors/space_node/drawnode.c | |
parent | 1093f69e506e56e0bf605c44aefc34d6f9bc27fe (diff) |
improve image sequence usability, problem was when the image didn't load there was no way to know the frame that blender was attempting to read.
added a label for image sequence images showing the image file's frame, even when not able to load, this also gives realtime feedback to the user while dragging the frame offset/start/duration buttons about so they can better understand how these settings work.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 7d92c308f17..b5bb635b544 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -482,6 +482,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * bNode *node= ptr->data; PointerRNA imaptr; PropertyRNA *prop; + int source; uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL); @@ -495,7 +496,19 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * uiItemR(col, &imaptr, "source", 0, NULL, ICON_NONE); - if (ELEM(RNA_enum_get(&imaptr, "source"), IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { + source= RNA_enum_get(&imaptr, "source"); + + if(source == IMA_SRC_SEQUENCE) { + /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */ + Scene *scene= CTX_data_scene(C); + ImageUser *iuser= node->storage; + char tstr[32]; + const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0); + BLI_snprintf(tstr, sizeof(tstr), "Frame: %d", framenr); + uiItemL(layout, tstr, ICON_NONE); + } + + if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { col= uiLayoutColumn(layout, 1); uiItemR(col, ptr, "frame_duration", 0, NULL, ICON_NONE); uiItemR(col, ptr, "frame_start", 0, NULL, ICON_NONE); |