From 830dc342e2834d5fb531bc8d5b1d1bcb7b41e6f0 Mon Sep 17 00:00:00 2001 From: Rodney Date: May 12 2021 17:41:30 +0000 Subject: Merge pull request #3947 from shun-iwasawa/fix_mesh_file_naming Fix mesh file naming --- diff --git a/toonz/sources/toonz/meshifypopup.cpp b/toonz/sources/toonz/meshifypopup.cpp index cf57661..9f335c2 100644 --- a/toonz/sources/toonz/meshifypopup.cpp +++ b/toonz/sources/toonz/meshifypopup.cpp @@ -248,9 +248,13 @@ TXshSimpleLevel *createMeshLevel(TXshLevel *texturesLevel) { codedOrigPath = TFilePath( "+drawings/a"); // parent directory. Store them in "+drawings". + // temporarily disable underscore in order to get proper file path when the + // level name includes underscore like "sub_1" + TFilePath::setUnderscoreFormatAllowed(false); codedOrigPath = codedDstPath = codedOrigPath.withName(pathName).withType("mesh").withFrame( TFrameId::EMPTY_FRAME); + TFilePath::setUnderscoreFormatAllowed(true); origPath = dstPath = scene->decodeFilePath(codedOrigPath); @@ -260,9 +264,10 @@ TXshSimpleLevel *createMeshLevel(TXshLevel *texturesLevel) { while (TSystem::doesExistFileOrLevel(dstPath) || scene->getLevelSet()->hasLevel(*scene, codedDstPath)) { pathName = nameBuilder->getNext(); - + TFilePath::setUnderscoreFormatAllowed(false); codedDstPath = origPath.withName(pathName).withType("mesh").withFrame( TFrameId::EMPTY_FRAME); + TFilePath::setUnderscoreFormatAllowed(true); dstPath = scene->decodeFilePath(codedDstPath); } @@ -1312,7 +1317,7 @@ public: void execute() override { static MeshifyPopup *thePopup = 0; - if (!thePopup) thePopup = new MeshifyPopup; + if (!thePopup) thePopup = new MeshifyPopup; thePopup->raise(); thePopup->show();