Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Allow loading levels/images with numeric names.

Martin van Zijl2ffeac34fa52
diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp
index c7efeaf77..032f5f7a4 100644
--- a/toonz/sources/common/tsystem/tfilepath.cpp
+++ b/toonz/sources/common/tsystem/tfilepath.cpp
@@ -606,7 +606,8 @@ std::string TFilePath::getLevelName() const {
}
//-----------------------------------------------------------------------------
-// es. TFilePath("/pippo/pluto.0001.gif").getLevelName() == "pluto..gif"
+// es. TFilePath("/pippo/pluto.0001.tif").getLevelName() == "pluto..tif"
+// es. TFilePath("/pippo/0001.tif").getLevelName() == "0001.tif"
std::wstring TFilePath::getLevelNameW() const {
int i = getLastSlash(m_path); // cerco l'ultimo slash
@@ -622,7 +623,7 @@ std::wstring TFilePath::getLevelNameW() const {
if (j == i || j - i == 1) // prova.tif o prova..tif
return str;
- if (!checkForSeqNum(type) || !isNumbers(str, i, j)) return str;
+ if (!checkForSeqNum(type) || !isNumbers(str, i, j) || i == -1) return str;
// prova.0001.tif
return str.erase(i + 1, j - i - 1);
}