From 9dd0c5abe59d69357ac91e52954db5d1db81ec44 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 25 Jun 2007 13:01:46 +0000 Subject: Whoa, a new feature! Sequence Editor: SHIFT+R, Remap Paths (also in pull down menu) This allows to remap the root of a path to another directory. Works on all selected Image strips. That way you can make absolute paths relative, for example. Example: original path: /mnt/orange/finals/06_which_way/06_03b/ to be remapped: /mnt/orange/finals/ remap to: // new path: //06_which_way/06_03b/ --- source/blender/src/editseq.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'source/blender/src/editseq.c') diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index 1677fe49c59..968d1965ef4 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -1981,6 +1981,48 @@ void set_filter_seq(void) } +void seq_remap_paths(void) +{ + Sequence *seq, *last_seq = get_last_seq(); + Editing *ed; + char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX]; + + ed= G.scene->ed; + if(ed==NULL || last_seq==NULL) + return; + + BLI_strncpy(from, last_seq->strip->dir, FILE_MAX); + if (0==sbutton(from, 0, sizeof(from)-1, "From: ")) + return; + + strcpy(to, from); + if (0==sbutton(to, 0, sizeof(to)-1, "To: ")) + return; + + if (strcmp(to, from)==0) + return; + + WHILE_SEQ(ed->seqbasep) { + if(seq->flag & SELECT) { + if(strncmp(seq->strip->dir, from, strlen(from))==0) { + printf("found %s\n", seq->strip->dir); + + /* strip off the beginning */ + stripped[0]= 0; + BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX); + + /* new path */ + BLI_strncpy(seq->strip->dir, to, FILE_MAX); + strcat(seq->strip->dir, stripped); + printf("new %s\n", seq->strip->dir); + } + } + } + END_SEQ + + BIF_undo_push("Remap paths in Sequencer"); + allqueue(REDRAWSEQ, 0); +} void no_gaps(void) -- cgit v1.2.3