Skip to content

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

C

Project Settings: Add "Allow No Separator Before Frame Number" Option

shun-iwasawafc5815de4195
diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp
index e4e91d1a8..d3b8bebd9 100644
--- a/toonz/sources/common/tsystem/tfilepath.cpp
+++ b/toonz/sources/common/tsystem/tfilepath.cpp
@@ -29,7 +29,8 @@ const wchar_t wauxslash = L'\\';
#include <QObject>
#include <QRegularExpression>
-bool TFilePath::m_underscoreFormatAllowed = true;
+bool TFilePath::m_underscoreFormatAllowed = true;
+bool TFilePath::m_noSeparatorFormatAllowed = false;
// specifies file path condition for sequential image for each project.
// See filepathproperties.h
@@ -128,12 +129,14 @@ std::string TFrameId::expand(FrameFormat format) const {
else if (m_frame == NO_FRAME)
return "-";
std::ostringstream o_buff;
- if (format == FOUR_ZEROS || format == UNDERSCORE_FOUR_ZEROS) {
+ if (format == FOUR_ZEROS || format == UNDERSCORE_FOUR_ZEROS ||
+ format == NO_SEP_FOUR_ZEROS) {
o_buff.fill('0');
o_buff.width(4);
o_buff << m_frame;
o_buff.width(0);
- } else if (format == CUSTOM_PAD || format == UNDERSCORE_CUSTOM_PAD) {
+ } else if (format == CUSTOM_PAD || format == UNDERSCORE_CUSTOM_PAD ||
+ format == NO_SEP_CUSTOM_PAD) {
o_buff.fill('0');
o_buff.width(m_zeroPadding);
o_buff << m_frame;
@@ -863,7 +866,11 @@ TFilePath TFilePath::withName(const std::wstring &name) const {
QString ret = info.parentDir + QString::fromStdWString(name);
if (info.fId.getNumber() != TFrameId::NO_FRAME) {
- QString sepChar = (info.sepChar.isNull()) ? "." : QString(info.sepChar);
+ QString sepChar = (info.sepChar.isNull()) ? "."
+ : (info.sepChar == QChar('#') &&
+ info.fId.getNumber() != TFrameId::EMPTY_FRAME)
+ ? ""
+ : QString(info.sepChar);
ret += sepChar + QString::fromStdString(
info.fId.expand(info.fId.getCurrentFormat()));
}
@@ -908,6 +915,9 @@ TFilePath TFilePath::withParentDir(const TFilePath &dir) const {
}
//-----------------------------------------------------------------------------
+// TODO: This function might need to create a path based on
+// the value of `format` unless `format` is set to `USE_CURRENT_FORMAT`.
+// The potential impact must be investigated before making such changes.
TFilePath TFilePath::withFrame(const TFrameId &frame,
TFrameId::FrameFormat format) const {
@@ -928,7 +938,10 @@ TFilePath TFilePath::withFrame(const TFrameId &frame,
return TFilePath(info.parentDir + info.levelName + "." + info.extension);
}
QString sepChar = (info.sepChar.isNull()) ? QString(frame.getStartSeqInd())
- : QString(info.sepChar);
+ : (info.sepChar == QChar('#') &&
+ frame.getNumber() != TFrameId::EMPTY_FRAME)
+ ? QString("")
+ : QString(info.sepChar);
return TFilePath(info.parentDir + info.levelName + sepChar +
QString::fromStdString(frame.expand(format)) + "." +
@@ -1085,7 +1098,9 @@ QString TFilePath::fidRegExpStr() {
QString countLetter = (m_letterCountForSuffix == 0)
? "{0,}"
: (QString("{0,%1}").arg(m_letterCountForSuffix));
- return QString("(\\d+)(%1%2)").arg(suffixLetter).arg(countLetter);
+ return QString("(?<framenum>\\d+)(?<suffix>%1%2)")
+ .arg(suffixLetter)
+ .arg(countLetter);
// const QString fIdRegExp("(\\d+)([a-zA-Z]?)");
}
@@ -1114,14 +1129,15 @@ TFilePath::TFilePathInfo TFilePath::analyzePath() const {
QString fileName = QString::fromStdWString(str);
// Level Name : letters other than \/:,;*?"<>|
- const QString levelNameRegExp("([^\\\\/:,;*?\"<>|]+)");
+ QString levelNameRegExp("(?<levelname>[^\\\\/:,;*?\"<>|]+)");
// Sep Char : period or underscore
- const QString sepCharRegExp("([\\._])");
+ const QString sepCharRegExp("(?<sepchar>[\\._])");
+
// Frame Number and Suffix
QString fIdRegExp = TFilePath::fidRegExpStr();
// Extension: letters other than "._" or \/:,;*?"<>| or " "(space)
- const QString extensionRegExp("([^\\._ \\\\/:,;*?\"<>|]+)");
+ const QString extensionRegExp("(?<extension>[^\\._ \\\\/:,;*?\"<>|]+)");
// Modern QRegularExpression implementation
QRegularExpression rx("^(?:" + levelNameRegExp + ")?" + sepCharRegExp +
@@ -1130,20 +1146,23 @@ TFilePath::TFilePathInfo TFilePath::analyzePath() const {
QRegularExpressionMatch match = rx.match(fileName);
if (match.hasMatch()) {
- info.levelName = match.captured(1);
- info.sepChar =
- match.captured(2).isEmpty() ? QChar() : match.captured(2).at(0);
- info.extension = match.captured(5);
+ info.levelName = match.captured("levelname");
+ info.sepChar = match.captured("sepchar").isEmpty()
+ ? QChar()
+ : match.captured("sepchar").at(0);
+ info.extension = match.captured("extension");
// ignore frame numbers on non-sequential (i.e. movie) extension case
if (!checkForSeqNum(info.extension)) {
- info.levelName = match.captured(1) + match.captured(2);
- if (!match.captured(3).isEmpty()) info.levelName += match.captured(3);
- if (!match.captured(4).isEmpty()) info.levelName += match.captured(4);
+ info.levelName = match.captured("levelname") + match.captured("sepchar");
+ if (!match.captured("framenum").isEmpty())
+ info.levelName += match.captured("framenum");
+ if (!match.captured("suffix").isEmpty())
+ info.levelName += match.captured("suffix");
info.sepChar = QChar();
info.fId = TFrameId(TFrameId::NO_FRAME, 0, 0); // initialize with NO_PAD
} else {
- QString numberStr = match.captured(3);
+ QString numberStr = match.captured("framenum");
if (numberStr.isEmpty()) { // empty frame case : hogehoge..jpg
info.fId =
TFrameId(TFrameId::EMPTY_FRAME, 0, 4, info.sepChar.toLatin1());
@@ -1154,12 +1173,60 @@ TFilePath::TFilePathInfo TFilePath::analyzePath() const {
padding = numberStr.length();
}
QString suffix;
- if (!match.captured(4).isEmpty()) suffix = match.captured(4);
+ if (!match.captured("suffix").isEmpty())
+ suffix = match.captured("suffix");
info.fId = TFrameId(number, suffix, padding, info.sepChar.toLatin1());
}
}
return info;
}
+ // check no-separator sequencial images case (hogehoge0001.jpg /
+ // hogehoge#.jpg)
+ if (m_noSeparatorFormatAllowed) {
+ // level name must be ended with non-digit
+ QString levelNameRegExp_nosep =
+ QString("(?<levelname>[^\\\\/:,;*?\"<>|]*[^\\d\\\\/:,;*?\"<>|])");
+ // check again without separator
+ QRegularExpression rx_nosep("^(?:" + levelNameRegExp_nosep + ")?" +
+ "(?:(?<sepchar>#)|(?:" + fIdRegExp + "))" +
+ "\\." + extensionRegExp + "$");
+ match = rx_nosep.match(fileName);
+
+ if (match.hasMatch()) {
+ info.levelName = match.captured("levelname");
+ info.sepChar = QChar('#');
+ info.extension = match.captured("extension");
+
+ // ignore frame numbers on non-sequential (i.e. movie) extension case
+ if (!checkForSeqNum(info.extension)) {
+ info.levelName = match.captured("levelname");
+ if (!match.captured("framenum").isEmpty())
+ info.levelName += match.captured("framenum");
+ if (!match.captured("suffix").isEmpty())
+ info.levelName += match.captured("suffix");
+ info.sepChar = QChar();
+ info.fId =
+ TFrameId(TFrameId::NO_FRAME, 0, 0); // initialize with NO_PAD
+ } else {
+ QString numberStr = match.captured("framenum");
+ if (numberStr.isEmpty()) { // empty frame case : hogehoge#.jpg
+ info.fId =
+ TFrameId(TFrameId::EMPTY_FRAME, 0, 4, info.sepChar.toLatin1());
+ } else {
+ int number = numberStr.toInt();
+ int padding = 0;
+ if (!numberStr.isEmpty() && numberStr[0] == '0') { // with padding
+ padding = numberStr.length();
+ }
+ QString suffix;
+ if (!match.captured("suffix").isEmpty())
+ suffix = match.captured("suffix");
+ info.fId = TFrameId(number, suffix, padding, info.sepChar.toLatin1());
+ }
+ }
+ return info;
+ }
+ }
// no frame case : hogehoge.jpg
// no level name case : .jpg
@@ -1167,10 +1234,11 @@ TFilePath::TFilePathInfo TFilePath::analyzePath() const {
extensionRegExp + "$");
match = rx_nf.match(fileName);
if (match.hasMatch()) {
- if (!match.captured(1).isEmpty()) info.levelName = match.captured(1);
+ if (!match.captured("levelname").isEmpty())
+ info.levelName = match.captured("levelname");
info.sepChar = QChar();
info.fId = TFrameId(TFrameId::NO_FRAME, 0, 0); // initialize with NO_PAD
- info.extension = match.captured(2);
+ info.extension = match.captured("extension");
return info;
}
diff --git a/toonz/sources/include/tfilepath.h b/toonz/sources/include/tfilepath.h
index ab98160f4..bd52fad47 100644
--- a/toonz/sources/include/tfilepath.h
+++ b/toonz/sources/include/tfilepath.h
@@ -44,8 +44,11 @@ public:
NO_PAD,
UNDERSCORE_FOUR_ZEROS, // pippo_0001.tif
UNDERSCORE_NO_PAD,
+ NO_SEP_FOUR_ZEROS, // pippo0001.tif
+ NO_SEP_NO_PAD,
CUSTOM_PAD,
UNDERSCORE_CUSTOM_PAD,
+ NO_SEP_CUSTOM_PAD,
USE_CURRENT_FORMAT
}; // pippo_1.tif
@@ -103,14 +106,21 @@ public:
FrameFormat getCurrentFormat() const {
switch (m_zeroPadding) {
case 0:
- return (m_startSeqInd == '.' ? NO_PAD : UNDERSCORE_NO_PAD);
+ return (m_startSeqInd == '.'
+ ? NO_PAD
+ : (m_startSeqInd == '_' ? UNDERSCORE_NO_PAD : NO_SEP_NO_PAD));
case 4:
- return (m_startSeqInd == '.' ? FOUR_ZEROS : UNDERSCORE_FOUR_ZEROS);
+ return (m_startSeqInd == '.'
+ ? FOUR_ZEROS
+ : (m_startSeqInd == '_' ? UNDERSCORE_FOUR_ZEROS
+ : NO_SEP_FOUR_ZEROS));
default:
break;
}
- return (m_startSeqInd == '.' ? CUSTOM_PAD : UNDERSCORE_CUSTOM_PAD);
+ return (m_startSeqInd == '.' ? CUSTOM_PAD
+ : (m_startSeqInd == '_' ? UNDERSCORE_CUSTOM_PAD
+ : NO_SEP_CUSTOM_PAD));
}
};
@@ -134,6 +144,7 @@ inline std::ostream &operator<<(std::ostream &out, const TFrameId &f) {
constructor.*/
class DVAPI TFilePath {
static bool m_underscoreFormatAllowed;
+ static bool m_noSeparatorFormatAllowed;
// Specifies file path condition for sequential images per project.
// See filepathproperties.h
@@ -146,7 +157,7 @@ class DVAPI TFilePath {
struct TFilePathInfo {
QString parentDir; // with slash
QString levelName;
- QChar sepChar; // either "." or "_"
+ QChar sepChar; // either "." or "_", or "#" (indicates no separator)
TFrameId fId;
QString extension;
};
@@ -159,18 +170,23 @@ public:
static void setUnderscoreFormatAllowed(bool state) {
m_underscoreFormatAllowed = state;
}
-
+ static void setNoSeparatorFormatAllowed(bool state) {
+ m_noSeparatorFormatAllowed = state;
+ }
// Called from TProjectManager::getCurrentProject() and
// ProjectPopup::updateProjectFromFields Returns true if something changed
static bool setFilePathProperties(bool useStandard, bool acceptNonAlphaSuffix,
- int letterCountForSuffix) {
+ int letterCountForSuffix,
+ bool allowNoSeparatorFormat) {
if (m_useStandard == useStandard &&
m_acceptNonAlphabetSuffix == acceptNonAlphaSuffix &&
- m_letterCountForSuffix == letterCountForSuffix)
+ m_letterCountForSuffix == letterCountForSuffix &&
+ m_noSeparatorFormatAllowed == allowNoSeparatorFormat)
return false;
- m_useStandard = useStandard;
- m_acceptNonAlphabetSuffix = acceptNonAlphaSuffix;
- m_letterCountForSuffix = letterCountForSuffix;
+ m_useStandard = useStandard;
+ m_acceptNonAlphabetSuffix = acceptNonAlphaSuffix;
+ m_letterCountForSuffix = letterCountForSuffix;
+ m_noSeparatorFormatAllowed = allowNoSeparatorFormat;
return true;
}
static bool useStandard() { return m_useStandard; }
diff --git a/toonz/sources/include/toonz/filepathproperties.h b/toonz/sources/include/toonz/filepathproperties.h
index 4c61ac96e..088dfd6e9 100644
--- a/toonz/sources/include/toonz/filepathproperties.h
+++ b/toonz/sources/include/toonz/filepathproperties.h
@@ -27,6 +27,7 @@ class DVAPI FilePathProperties {
bool m_useStandard;
bool m_acceptNonAlphabetSuffix;
int m_letterCountForSuffix;
+ bool m_noSeparatorFormatAllowed;
public:
FilePathProperties();
@@ -40,6 +41,9 @@ public:
int letterCountForSuffix() { return m_letterCountForSuffix; }
void setLetterCountForSuffix(int val) { m_letterCountForSuffix = val; }
+ bool noSeparatorFormatAllowed() { return m_noSeparatorFormatAllowed; }
+ void setNoSeparatorFormatAllowed(bool on) { m_noSeparatorFormatAllowed = on; }
+
void saveData(TOStream& os) const;
void loadData(TIStream& is);
diff --git a/toonz/sources/tcleanupper/tcleanupper.cpp b/toonz/sources/tcleanupper/tcleanupper.cpp
index 507b4f724..34d4a019b 100644
--- a/toonz/sources/tcleanupper/tcleanupper.cpp
+++ b/toonz/sources/tcleanupper/tcleanupper.cpp
@@ -599,9 +599,9 @@ int main(int argc, char *argv[]) {
// update TFilePath condition on loading the current project
FilePathProperties *fpProp = project->getFilePathProperties();
- TFilePath::setFilePathProperties(fpProp->useStandard(),
- fpProp->acceptNonAlphabetSuffix(),
- fpProp->letterCountForSuffix());
+ TFilePath::setFilePathProperties(
+ fpProp->useStandard(), fpProp->acceptNonAlphabetSuffix(),
+ fpProp->letterCountForSuffix(), fpProp->noSeparatorFormatAllowed());
TFilePath fp = srcName;
@@ -630,7 +630,7 @@ int main(int argc, char *argv[]) {
else {
try {
TProjectManager *pm = TProjectManager::instance();
- auto sceneProject = pm->loadSceneProject(fp);
+ auto sceneProject = pm->loadSceneProject(fp);
if (!sceneProject) {
cerr << "can't open project." << endl;
return -3;
diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cpp
index 720453a22..785425faa 100644
--- a/toonz/sources/tcomposer/tcomposer.cpp
+++ b/toonz/sources/tcomposer/tcomposer.cpp
@@ -827,9 +827,9 @@ int main(int argc, char *argv[]) {
// update TFilePath condition on loading the current project
FilePathProperties *fpProp = project->getFilePathProperties();
- TFilePath::setFilePathProperties(fpProp->useStandard(),
- fpProp->acceptNonAlphabetSuffix(),
- fpProp->letterCountForSuffix());
+ TFilePath::setFilePathProperties(
+ fpProp->useStandard(), fpProp->acceptNonAlphabetSuffix(),
+ fpProp->letterCountForSuffix(), fpProp->noSeparatorFormatAllowed());
Sw1.start();
diff --git a/toonz/sources/toonz/formatsettingspopups.cpp b/toonz/sources/toonz/formatsettingspopups.cpp
index 29df349ca..a10ef06b2 100644
--- a/toonz/sources/toonz/formatsettingspopups.cpp
+++ b/toonz/sources/toonz/formatsettingspopups.cpp
@@ -12,6 +12,8 @@
#include "toonz/toonzscene.h"
#include "toonz/tcamera.h"
#include "toutputproperties.h"
+#include "toonz/filepathproperties.h"
+#include "toonz/tproject.h"
#ifdef _WIN32
#include "avicodecrestrictions.h"
@@ -117,6 +119,13 @@ FormatSettingsPopup::FormatSettingsPopup(QWidget *parent,
m_sepCharCB->addItem(tr(". (period)"), QChar('.'));
m_sepCharCB->addItem(tr("_ (underscore)"), QChar('_'));
+
+ FilePathProperties *fpProp = TProjectManager::instance()
+ ->getCurrentProject()
+ ->getFilePathProperties();
+ if (!fpProp->useStandard() && fpProp->noSeparatorFormatAllowed())
+ m_sepCharCB->addItem(tr("(no separator)"), QChar('#'));
+
m_sepCharCB->setCurrentIndex(m_sepCharCB->findData(
QChar::fromLatin1(tmplFrameId->getStartSeqInd())));
diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cpp
index c64fd2cf9..8b39a0d19 100644
--- a/toonz/sources/toonz/projectpopup.cpp
+++ b/toonz/sources/toonz/projectpopup.cpp
@@ -300,6 +300,8 @@ ProjectPopup::ProjectPopup(bool isModal)
QRadioButton *standardRB = new QRadioButton(tr("Standard"), this);
QRadioButton *customRB =
new QRadioButton(QString("[Experimental] ") + tr("Custom"), this);
+ m_allowNoSeparatorFormatCB =
+ new CheckBox(tr("Allow No Separator Before Frame Number"), this);
m_acceptNonAlphabetSuffixCB =
new CheckBox(tr("Accept Non-alphabet Suffix"), this);
m_letterCountCombo = new QComboBox(this);
@@ -407,10 +409,11 @@ Note that this mode uses regular expression for file name validation and may slo
customLay->setHorizontalSpacing(10);
customLay->setVerticalSpacing(10);
{
- customLay->addWidget(m_acceptNonAlphabetSuffixCB, 0, 0, 1, 2);
+ customLay->addWidget(m_allowNoSeparatorFormatCB, 0, 0, 1, 2);
+ customLay->addWidget(m_acceptNonAlphabetSuffixCB, 1, 0, 1, 2);
customLay->addWidget(
- new QLabel(tr("Maximum Letter Count For Suffix"), this), 1, 0);
- customLay->addWidget(m_letterCountCombo, 1, 1);
+ new QLabel(tr("Maximum Letter Count For Suffix"), this), 2, 0);
+ customLay->addWidget(m_letterCountCombo, 2, 1);
}
customLay->setColumnStretch(2, 1);
fpLayout->addLayout(customLay, 0);
@@ -494,12 +497,14 @@ void ProjectPopup::updateFieldsFromProject(std::shared_ptr<TProject> project) {
}
// file path
- FilePathProperties *fpProp = project->getFilePathProperties();
- bool useStandard = fpProp->useStandard();
- bool acceptNonAlphabet = fpProp->acceptNonAlphabetSuffix();
- int letterCount = fpProp->letterCountForSuffix();
+ FilePathProperties *fpProp = project->getFilePathProperties();
+ bool useStandard = fpProp->useStandard();
+ bool acceptNonAlphabet = fpProp->acceptNonAlphabetSuffix();
+ int letterCount = fpProp->letterCountForSuffix();
+ bool noSeparatorFormatAllowed = fpProp->noSeparatorFormatAllowed();
m_rulePreferenceBG->button((useStandard) ? Rule_Standard : Rule_Custom)
->setChecked(true);
+ m_allowNoSeparatorFormatCB->setChecked(noSeparatorFormatAllowed);
m_acceptNonAlphabetSuffixCB->setChecked(acceptNonAlphabet);
m_letterCountCombo->setCurrentIndex(
m_letterCountCombo->findData(letterCount));
@@ -526,12 +531,14 @@ void ProjectPopup::updateProjectFromFields(std::shared_ptr<TProject> project) {
bool useStandard = m_rulePreferenceBG->checkedId() == Rule_Standard;
bool acceptNonAlphabet = m_acceptNonAlphabetSuffixCB->isChecked();
int letterCount = m_letterCountCombo->currentData().toInt();
+ bool allowNoSeparatorFormat = m_allowNoSeparatorFormatCB->isChecked();
fpProp->setUseStandard(useStandard);
fpProp->setAcceptNonAlphabetSuffix(acceptNonAlphabet);
fpProp->setLetterCountForSuffix(letterCount);
+ fpProp->setNoSeparatorFormatAllowed(allowNoSeparatorFormat);
if (TFilePath::setFilePathProperties(useStandard, acceptNonAlphabet,
- letterCount))
+ letterCount, allowNoSeparatorFormat))
DvDirModel::instance()->refreshFolderChild(QModelIndex()); // refresh all
TProjectManager::instance()->notifyProjectChanged();
@@ -559,6 +566,7 @@ void ProjectPopup::showEvent(QShowEvent *) {
//-----------------------------------------------------------------------------
void ProjectPopup::onRulePreferenceToggled(int id, bool on) {
+ m_allowNoSeparatorFormatCB->setEnabled((id == Rule_Custom) == on);
m_acceptNonAlphabetSuffixCB->setEnabled((id == Rule_Custom) == on);
m_letterCountCombo->setEnabled((id == Rule_Custom) == on);
}
@@ -597,6 +605,8 @@ ProjectSettingsPopup::ProjectSettingsPopup() : ProjectPopup(false) {
// file path settings
connect(m_rulePreferenceBG, SIGNAL(idClicked(int)), this,
SLOT(onSomethingChanged()));
+ connect(m_allowNoSeparatorFormatCB, SIGNAL(clicked(bool)), this,
+ SLOT(onSomethingChanged()));
connect(m_acceptNonAlphabetSuffixCB, SIGNAL(clicked(bool)), this,
SLOT(onSomethingChanged()));
connect(m_letterCountCombo, SIGNAL(activated(int)), this,
@@ -769,6 +779,7 @@ void ProjectCreatePopup::showEvent(QShowEvent *) {
// default file path settings
m_rulePreferenceBG->button(Rule_Standard)->setChecked(true);
+ m_allowNoSeparatorFormatCB->setChecked(false);
m_acceptNonAlphabetSuffixCB->setChecked(false);
m_letterCountCombo->setCurrentIndex(m_letterCountCombo->findData(1));
}
diff --git a/toonz/sources/toonz/projectpopup.h b/toonz/sources/toonz/projectpopup.h
index 96e31f607..51baee06f 100644
--- a/toonz/sources/toonz/projectpopup.h
+++ b/toonz/sources/toonz/projectpopup.h
@@ -121,6 +121,7 @@ protected:
// file path settings
QButtonGroup *m_rulePreferenceBG;
+ DVGui::CheckBox *m_allowNoSeparatorFormatCB;
DVGui::CheckBox *m_acceptNonAlphabetSuffixCB;
QComboBox *m_letterCountCombo;
diff --git a/toonz/sources/toonzlib/filepathproperties.cpp b/toonz/sources/toonzlib/filepathproperties.cpp
index 3b79a1a2a..7f1c6a3c3 100644
--- a/toonz/sources/toonzlib/filepathproperties.cpp
+++ b/toonz/sources/toonzlib/filepathproperties.cpp
@@ -6,17 +6,20 @@
FilePathProperties::FilePathProperties()
: m_useStandard(true)
, m_acceptNonAlphabetSuffix(false)
- , m_letterCountForSuffix(1) {}
+ , m_letterCountForSuffix(1)
+ , m_noSeparatorFormatAllowed(false) {}
bool FilePathProperties::isDefault() {
return (m_useStandard == true && m_acceptNonAlphabetSuffix == false &&
- m_letterCountForSuffix == 1);
+ m_letterCountForSuffix == 1 && m_noSeparatorFormatAllowed == false);
}
void FilePathProperties::saveData(TOStream& os) const {
os.child("useStandard") << ((m_useStandard) ? 1 : 0);
os.child("acceptNonAlphabetSuffix") << ((m_acceptNonAlphabetSuffix) ? 1 : 0);
os.child("letterCountForSuffix") << m_letterCountForSuffix;
+ os.child("noSeparatorFormatAllowed")
+ << ((m_noSeparatorFormatAllowed) ? 1 : 0);
}
// make sure to let TFilePath to know the new properties!
@@ -32,6 +35,9 @@ void FilePathProperties::loadData(TIStream& is) {
m_acceptNonAlphabetSuffix = (val == 1);
} else if (tagName == "letterCountForSuffix") {
is >> m_letterCountForSuffix;
+ } else if (tagName == "noSeparatorFormatAllowed") {
+ is >> val;
+ m_noSeparatorFormatAllowed = (val == 1);
}
is.closeChild();
}
diff --git a/toonz/sources/toonzlib/tproject.cpp b/toonz/sources/toonzlib/tproject.cpp
index baffe2a6a..02b20dc49 100644
--- a/toonz/sources/toonzlib/tproject.cpp
+++ b/toonz/sources/toonzlib/tproject.cpp
@@ -1022,9 +1022,9 @@ std::shared_ptr<TProject> TProjectManager::getCurrentProject() {
// update TFilePath condition on loading the current project
FilePathProperties *fpProp = currentProject->getFilePathProperties();
- TFilePath::setFilePathProperties(fpProp->useStandard(),
- fpProp->acceptNonAlphabetSuffix(),
- fpProp->letterCountForSuffix());
+ TFilePath::setFilePathProperties(
+ fpProp->useStandard(), fpProp->acceptNonAlphabetSuffix(),
+ fpProp->letterCountForSuffix(), fpProp->noSeparatorFormatAllowed());
}
return currentProject;
}