Changed frame numbering to only alter hashes if they are in the filename (not the directory name) to fix bug [#10566] File Open Dialog replaces '#' with '0' in directory names.
removed frame numbering from BLI_convertstringcode into its own function (BLI_convertstringframe), many uses of BLI_convertstringcode were passing dummy frames values anyway. in cases where adding the current frame number to a filename is needed run BLI_convertstringframe(...) after BLI_convertstringcode(...) There are some cases Im not sure BLI_convertstringframe is needed, these have been commented as todo, but at least have the same functionality they used to.
This commit is contained in:
@@ -371,7 +371,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char upydir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(upydir, U.pythondir, FILE_MAX);
|
||||
BLI_convertstringcode(upydir, G.sce, 0);
|
||||
BLI_convertstringcode(upydir, G.sce);
|
||||
|
||||
if (BLI_exists(upydir)) {
|
||||
char udatadir[FILE_MAXDIR];
|
||||
@@ -397,7 +397,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char upydir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(upydir, U.pythondir, FILE_MAX);
|
||||
BLI_convertstringcode(upydir, G.sce, 0);
|
||||
BLI_convertstringcode(upydir, G.sce);
|
||||
|
||||
if( BLI_exists( upydir ) )
|
||||
ret = PyString_FromString( upydir );
|
||||
@@ -410,7 +410,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char yfexportdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(yfexportdir, U.yfexportdir, FILE_MAX);
|
||||
BLI_convertstringcode(yfexportdir, G.sce, 0);
|
||||
BLI_convertstringcode(yfexportdir, G.sce);
|
||||
|
||||
if( BLI_exists( yfexportdir ) )
|
||||
ret = PyString_FromString( yfexportdir );
|
||||
@@ -423,7 +423,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char fontdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(fontdir, U.fontdir, FILE_MAX);
|
||||
BLI_convertstringcode(fontdir, G.sce, 0);
|
||||
BLI_convertstringcode(fontdir, G.sce);
|
||||
|
||||
if( BLI_exists( fontdir ) )
|
||||
ret = PyString_FromString( fontdir );
|
||||
@@ -436,7 +436,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char textudir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(textudir, U.textudir, FILE_MAX);
|
||||
BLI_convertstringcode(textudir, G.sce, 0);
|
||||
BLI_convertstringcode(textudir, G.sce);
|
||||
|
||||
if( BLI_exists( textudir ) )
|
||||
ret = PyString_FromString( textudir );
|
||||
@@ -449,7 +449,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char plugtexdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(plugtexdir, U.plugtexdir, FILE_MAX);
|
||||
BLI_convertstringcode(plugtexdir, G.sce, 0);
|
||||
BLI_convertstringcode(plugtexdir, G.sce);
|
||||
|
||||
if( BLI_exists( plugtexdir ) )
|
||||
ret = PyString_FromString( plugtexdir );
|
||||
@@ -462,7 +462,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char plugseqdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(plugseqdir, U.plugseqdir, FILE_MAX);
|
||||
BLI_convertstringcode(plugseqdir, G.sce, 0);
|
||||
BLI_convertstringcode(plugseqdir, G.sce);
|
||||
|
||||
if( BLI_exists( plugseqdir ) )
|
||||
ret = PyString_FromString( plugseqdir );
|
||||
@@ -475,7 +475,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char renderdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(renderdir, U.renderdir, FILE_MAX);
|
||||
BLI_convertstringcode(renderdir, G.sce, 0);
|
||||
BLI_convertstringcode(renderdir, G.sce);
|
||||
|
||||
if( BLI_exists( renderdir ) )
|
||||
ret = PyString_FromString( renderdir );
|
||||
@@ -488,7 +488,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char sounddir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(sounddir, U.sounddir, FILE_MAX);
|
||||
BLI_convertstringcode(sounddir, G.sce, 0);
|
||||
BLI_convertstringcode(sounddir, G.sce);
|
||||
|
||||
if( BLI_exists( sounddir ) )
|
||||
ret = PyString_FromString( sounddir );
|
||||
@@ -501,7 +501,7 @@ static PyObject *Blender_Get( PyObject * self, PyObject * value )
|
||||
char tempdir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(tempdir, U.tempdir, FILE_MAX);
|
||||
BLI_convertstringcode(tempdir, G.sce, 0);
|
||||
BLI_convertstringcode(tempdir, G.sce);
|
||||
|
||||
if( BLI_exists( tempdir ) )
|
||||
ret = PyString_FromString( tempdir );
|
||||
@@ -776,7 +776,7 @@ static PyObject *Blender_ShowHelp(PyObject *self, PyObject *script)
|
||||
char upydir[FILE_MAX];
|
||||
|
||||
BLI_strncpy(upydir, U.pythondir, FILE_MAX);
|
||||
BLI_convertstringcode(upydir, G.sce, 0);
|
||||
BLI_convertstringcode(upydir, G.sce);
|
||||
BLI_make_file_string("/", hspath, upydir, "help_browser.py");
|
||||
|
||||
if (!BLI_exists(hspath))
|
||||
|
||||
@@ -166,7 +166,7 @@ static PyObject *M_Library_Open( PyObject * self, PyObject * value )
|
||||
|
||||
/* copy the name to make it absolute so BLO_blendhandle_from_file doesn't complain */
|
||||
BLI_strncpy(fname1, fname, sizeof(fname1));
|
||||
BLI_convertstringcode(fname1, G.sce, 0); /* make absolute */
|
||||
BLI_convertstringcode(fname1, G.sce); /* make absolute */
|
||||
|
||||
/* G.sce = last file loaded, save for UI and restore after opening file */
|
||||
BLI_strncpy(filename, G.sce, sizeof(filename));
|
||||
@@ -483,7 +483,7 @@ static BlendHandle *open_library( char *filename, char *longFilename )
|
||||
|
||||
/* get complete file name if necessary */
|
||||
BLI_strncpy( longFilename, filename, FILE_MAX );
|
||||
BLI_convertstringcode( longFilename, G.sce, 0 );
|
||||
BLI_convertstringcode( longFilename, G.sce );
|
||||
|
||||
/* throw exceptions for wrong file type, cyclic reference */
|
||||
if( !BLO_has_bfile_extension(longFilename) ) {
|
||||
|
||||
@@ -391,7 +391,8 @@ static PyObject *M_sys_expandpath( PyObject * self, PyObject * value )
|
||||
"expected string argument" );
|
||||
|
||||
BLI_strncpy(expanded, path, FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_convertstringcode(expanded, G.sce, G.scene->r.cfra);
|
||||
BLI_convertstringcode(expanded, G.sce);
|
||||
BLI_convertstringframe(expanded, G.scene->r.cfra);
|
||||
|
||||
return PyString_FromString(expanded);
|
||||
}
|
||||
|
||||
@@ -612,8 +612,8 @@ PyObject *RenderData_Play( BPy_RenderData * self )
|
||||
{
|
||||
|
||||
strcpy( file, self->renderContext->pic );
|
||||
BLI_convertstringcode( file, G.sce,
|
||||
self->renderContext->cfra );
|
||||
BLI_convertstringcode( file, G.sce );
|
||||
|
||||
BLI_make_existing_file( file );
|
||||
if( BLI_strcasecmp( file + strlen( file ) - 4, ".avi" ) ) {
|
||||
sprintf( txt, "%04d_%04d.avi",
|
||||
|
||||
Reference in New Issue
Block a user