Skip to content

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

C

fix export board image

shun-iwasawa3cd20743ec37
diff --git a/toonz/sources/toonz/boardsettingspopup.cpp b/toonz/sources/toonz/boardsettingspopup.cpp
index 1717bc962..a58e5784a 100644
--- a/toonz/sources/toonz/boardsettingspopup.cpp
+++ b/toonz/sources/toonz/boardsettingspopup.cpp
@@ -1154,9 +1154,12 @@ void BoardSettingsPopup::onExportBoardImage() {
QString levelName = QString::fromStdString(rendPath.getLevelName());
int dotPos = levelName.lastIndexOf('.');
- QString fileName = baseName + rendPath.getSepChar() +
- boardSettings->fileNameSuffix() +
- levelName.right(levelName.size() - dotPos);
+ QString suffix = boardSettings->fileNameSuffix();
+ // if the suffix starts with "." or "_", then replace the sepchar
+ if (!suffix.startsWith('.') && !suffix.startsWith('_'))
+ suffix.prepend(rendPath.getSepChar());
+ QString fileName =
+ baseName + suffix + levelName.right(levelName.size() - dotPos);
popup.setFilename(TFilePath(fileName));