[Bf-blender-cvs] [c5fc9eb] gooseberry: Animation support for collapsed image sequences.
Antony Riakiotakis
noreply at git.blender.org
Mon Jun 8 16:56:12 CEST 2015
Commit: c5fc9ebfcb2b4067dc9f897bab9882639a7a7e12
Author: Antony Riakiotakis
Date: Mon Jun 8 16:55:10 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBc5fc9ebfcb2b4067dc9f897bab9882639a7a7e12
Animation support for collapsed image sequences.
Selected animation sequences will play back their thumbnails now.
We'll probably need a way to scrub here, will investigate that next.
===================================================================
M source/blender/blenlib/BLI_fileops_types.h
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_file/file_ops.c
M source/blender/editors/space_file/filelist.c
===================================================================
diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h
index ea1b5d5..e596fa5 100644
--- a/source/blender/blenlib/BLI_fileops_types.h
+++ b/source/blender/blenlib/BLI_fileops_types.h
@@ -52,6 +52,7 @@ typedef struct CollapsedEntry {
int maxframe;
int numdigits;
int totfiles;
+ int curfra;
} CollapsedEntry;
struct direntry {
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index cbbd1cf..c89980e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -64,6 +64,7 @@
#include "UI_resources.h"
#include "UI_view2d.h"
+#include "WM_api.h"
#include "WM_types.h"
#include "filelist.h"
@@ -573,6 +574,14 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
file_draw_preview(block, file, sx, sy, imb, layout, is_icon, do_drag);
+
+ if ((file->selflag & FILE_SEL_COLLAPSED) && (file->selflag & FILE_SEL_SELECTED)) {
+ /* refresh to keep movie playing */
+ file->collapsed_info.curfra++;
+ file->collapsed_info.curfra %= file->collapsed_info.totfiles;
+
+ WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
+ }
}
else {
file_draw_icon(block, file->path, sx, sy - (UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE, do_drag);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index ab0e1da..9177899 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -274,6 +274,7 @@ static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *
if (FILENAME_IS_CURRPAR(file->relname)) {
file->selflag &= ~FILE_SEL_HIGHLIGHTED;
+ file->collapsed_info.curfra = 0;
}
/* active_file gets highlighted as well - make sure it is no readonly file */
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 7602844..db71f40 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -710,6 +710,7 @@ ImBuf *filelist_getimage(struct FileList *filelist, const int index)
{
ImBuf *ibuf = NULL;
int fidx = 0;
+ struct direntry *file;
BLI_assert(G.background == false);
@@ -717,8 +718,15 @@ ImBuf *filelist_getimage(struct FileList *filelist, const int index)
return NULL;
}
fidx = filelist->fidx[index];
- ibuf = filelist->filelist[fidx].image;
+ file = filelist->filelist + fidx;
+ if (file->selflag & FILE_SEL_COLLAPSED) {
+ int curfra = file->collapsed_info.curfra;
+ ibuf = file->collapsed_info.darray[curfra]->image;
+ }
+ else {
+ ibuf = filelist->filelist[fidx].image;
+ }
return ibuf;
}
@@ -769,7 +777,10 @@ ImBuf *filelist_geticon(struct FileList *filelist, const int index)
ibuf = gSpecialFileImages[SPECIAL_IMG_TEXTFILE];
}
else if (file->flags & FILE_TYPE_IMAGE) {
- ibuf = gSpecialFileImages[SPECIAL_IMG_LOADING];
+ if (file->selflag & FILE_SEL_COLLAPSED)
+ ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
+ else
+ ibuf = gSpecialFileImages[SPECIAL_IMG_LOADING];
}
else if (file->flags & FILE_TYPE_BLENDER_BACKUP) {
ibuf = gSpecialFileImages[SPECIAL_IMG_BACKUP];
More information about the Bf-blender-cvs
mailing list