Changed frame numbering to only alter hashes if they are in the filename (not the...
[blender-staging.git] / source / blender / src / sequence.c
index 9e6f1996e7521d5ec68a3d831af21ac9bd550b3d..9f3be52af1bd7a7323b1eee2ed7b1d151591b72d 100644 (file)
@@ -1,15 +1,12 @@
 /**
  * $Id$
  *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License.  See http://www.blender.org/BL/ for information
- * about this.
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -25,7 +22,7 @@
  *
  * Contributor(s): Peter Schlaile <peter [at] schlaile [dot] de> 2005/2006
  *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ * ***** END GPL LICENSE BLOCK *****
  */
 
 #include <string.h>
@@ -432,7 +429,9 @@ void reload_sequence_new_file(Sequence * seq)
                strncpy(str, seq->strip->dir, FILE_MAXDIR-1);
                strncat(str, seq->strip->stripdata->name, FILE_MAXFILE-1);
 
-               BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
+               BLI_convertstringcode(str, G.sce);
+               BLI_convertstringframe(str, G.scene->r.cfra); /* TODO - is this needed? */
+               
        }
 
        if (seq->type == SEQ_IMAGE) {
@@ -1059,7 +1058,7 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name)
 
                frameno = tse->nr + seq->anim_startofs;
 
-               snprintf(name, PROXY_MAXFILE, "%s/%s/%d/#", dir,
+               snprintf(name, PROXY_MAXFILE, "%s/%s/%d/####", dir,
                         seq->strip->stripdata->name,
                         G.scene->r.size);
        } else {
@@ -1067,11 +1066,13 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name)
 
                frameno = tse->nr + seq->anim_startofs;
 
-               snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/#", dir,
+               snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
                         G.scene->r.size);
        }
 
-       BLI_convertstringcode(name, G.sce, frameno);
+       BLI_convertstringcode(name, G.sce);
+       BLI_convertstringframe(name, frameno);
+       
 
        strcat(name, ".jpg");
 
@@ -1709,7 +1710,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
                        
                        strncpy(name, seq->strip->dir, FILE_MAXDIR-1);
                        strncat(name, s_elem->name, FILE_MAXFILE);
-                       BLI_convertstringcode(name, G.sce, G.scene->r.cfra);
+                       BLI_convertstringcode(name, G.sce);
+                       BLI_convertstringframe(name, G.scene->r.cfra);
                        if (!build_proxy_run) {
                                se->ibuf = seq_proxy_fetch(seq, cfra);
                        }
@@ -1738,7 +1740,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
                                if(seq->anim==0) {
                                        strncpy(name, seq->strip->dir, FILE_MAXDIR-1);
                                        strncat(name, seq->strip->stripdata->name, FILE_MAXFILE-1);
-                                       BLI_convertstringcode(name, G.sce, G.scene->r.cfra);
+                                       BLI_convertstringcode(name, G.sce);
+                                       BLI_convertstringframe(name, G.scene->r.cfra);
                                
                                        seq->anim = openanim(name, IB_rect);
                                }