Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-06-25 17:01:46 +0400
committerTon Roosendaal <ton@blender.org>2007-06-25 17:01:46 +0400
commit9dd0c5abe59d69357ac91e52954db5d1db81ec44 (patch)
treee93532b845c91a4e6330cfa2a2a91bda7c582115 /source/blender/src/editseq.c
parentb5fb85aede4538dd5d8d3e2473124626b30aa1ef (diff)
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/
Diffstat (limited to 'source/blender/src/editseq.c')
-rw-r--r--source/blender/src/editseq.c42
1 files changed, 42 insertions, 0 deletions
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)