[Bf-blender-cvs] [d45ea33] master: Fix T37591: 'Extensions' option ignored for movies.

Campbell Barton noreply at git.blender.org
Mon Nov 25 07:01:36 CET 2013


Commit: d45ea33ff14b7feaae29fe992b4d20cb96a1f48e
Author: Campbell Barton
Date:   Mon Nov 25 16:59:10 2013 +1100
http://developer.blender.org/rBd45ea33ff14b7feaae29fe992b4d20cb96a1f48e

Fix T37591: 'Extensions' option ignored for movies.

===================================================================

M	source/blender/blenkernel/intern/writeavi.c
M	source/blender/blenkernel/intern/writeffmpeg.c
M	source/blender/blenlib/BLI_path_util.h
M	source/blender/blenlib/intern/path_util.c
M	source/blender/quicktime/apple/qtkit_export.m

===================================================================

diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index ff6212f..1d29ef7 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -132,9 +132,16 @@ static void filepath_avi(char *string, RenderData *rd)
 
 	BLI_make_existing_file(string);
 
-	if (!BLI_testextensie(string, ".avi")) {
-		BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
-		strcat(string, ".avi");
+	if (rd->scemode & R_EXTENSION) {
+		if (!BLI_testextensie(string, ".avi")) {
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+			strcat(string, ".avi");
+		}
+	}
+	else {
+		if (BLI_path_frame_check_chars(string)) {
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+		}
 	}
 }
 
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index bcf5e71..ff4300c 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1023,23 +1023,32 @@ void BKE_ffmpeg_filepath_get(char *string, RenderData *rd)
 		sprintf(autosplit, "_%03d", ffmpeg_autosplit_count);
 	}
 
-	while (*fe) {
-		if (BLI_strcasecmp(string + strlen(string) - strlen(*fe), *fe) == 0) {
-			break;
+	if (rd->scemode & R_EXTENSION) {
+		while (*fe) {
+			if (BLI_strcasecmp(string + strlen(string) - strlen(*fe), *fe) == 0) {
+				break;
+			}
+			fe++;
 		}
-		fe++;
-	}
 
-	if (*fe == NULL) {
-		strcat(string, autosplit);
+		if (*fe == NULL) {
+			strcat(string, autosplit);
 
-		BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
-		strcat(string, *exts);
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+			strcat(string, *exts);
+		}
+		else {
+			*(string + strlen(string) - strlen(*fe)) = 0;
+			strcat(string, autosplit);
+			strcat(string, *fe);
+		}
 	}
 	else {
-		*(string + strlen(string) - strlen(*fe)) = 0;
+		if (BLI_path_frame_check_chars(string)) {
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+		}
+
 		strcat(string, autosplit);
-		strcat(string, *fe);
 	}
 }
 
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 9b461db..0cffa28 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -158,6 +158,7 @@ bool BLI_has_parent(char *path);
 bool BLI_path_abs(char *path, const char *basepath);
 bool BLI_path_frame(char *path, int frame, int digits);
 bool BLI_path_frame_range(char *path, int sta, int end, int digits);
+bool BLI_path_frame_check_chars(const char *path);
 bool BLI_path_cwd(char *path);
 void BLI_path_rel(char *file, const char *relfile);
 
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 4b8ee6e..3900ee0 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -720,6 +720,15 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits)
 }
 
 /**
+ * Check if we have '#' chars, usable for #BLI_path_frame, #BLI_path_frame_range
+ */
+bool BLI_path_frame_check_chars(const char *path)
+{
+	int ch_sta, ch_end;  /* dummy args */
+	return stringframe_chars(path, &ch_sta, &ch_end);
+}
+
+/**
  * If path begins with "//", strips that and replaces it with basepath directory. Also converts
  * a drive-letter prefix to something more sensible if this is a non-drive-letter-based system.
  * Returns true if "//" prefix expansion was done.
diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m
index 8cf91e4..0c193df 100644
--- a/source/blender/quicktime/apple/qtkit_export.m
+++ b/source/blender/quicktime/apple/qtkit_export.m
@@ -242,14 +242,17 @@ void filepath_qt(char *string, RenderData *rd)
 	BLI_path_abs(string, G.main->name);
 	
 	BLI_make_existing_file(string);
-	
-	if (!BLI_testextensie(string, ".mov")) {
-		/* if we don't have any #'s to insert numbers into, use 4 numbers by default */
-		if (strchr(string, '#')==NULL)
-			strcat(string, "####"); /* 4 numbers */
 
-		BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
-		strcat(string, ".mov");
+	if (rd->scemode & R_EXTENSION) {
+		if (!BLI_testextensie(string, ".mov")) {
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+			strcat(string, ".mov");
+		}
+	}
+	else {
+		if (BLI_path_frame_check_chars(string)) {
+			BLI_path_frame_range(string, rd->sfra, rd->efra, 4);
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list