fix mesh file naming

This commit is contained in:
shun-iwasawa 2021-05-12 10:40:48 +09:00 committed by manongjohn
parent 7f444c8c96
commit 66d96ac708

View file

@ -248,9 +248,13 @@ TXshSimpleLevel *createMeshLevel(TXshLevel *texturesLevel) {
codedOrigPath = TFilePath( codedOrigPath = TFilePath(
"+drawings/a"); // parent directory. Store them in "+drawings". "+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 = codedDstPath =
codedOrigPath.withName(pathName).withType("mesh").withFrame( codedOrigPath.withName(pathName).withType("mesh").withFrame(
TFrameId::EMPTY_FRAME); TFrameId::EMPTY_FRAME);
TFilePath::setUnderscoreFormatAllowed(true);
origPath = dstPath = scene->decodeFilePath(codedOrigPath); origPath = dstPath = scene->decodeFilePath(codedOrigPath);
@ -260,9 +264,10 @@ TXshSimpleLevel *createMeshLevel(TXshLevel *texturesLevel) {
while (TSystem::doesExistFileOrLevel(dstPath) || while (TSystem::doesExistFileOrLevel(dstPath) ||
scene->getLevelSet()->hasLevel(*scene, codedDstPath)) { scene->getLevelSet()->hasLevel(*scene, codedDstPath)) {
pathName = nameBuilder->getNext(); pathName = nameBuilder->getNext();
TFilePath::setUnderscoreFormatAllowed(false);
codedDstPath = origPath.withName(pathName).withType("mesh").withFrame( codedDstPath = origPath.withName(pathName).withType("mesh").withFrame(
TFrameId::EMPTY_FRAME); TFrameId::EMPTY_FRAME);
TFilePath::setUnderscoreFormatAllowed(true);
dstPath = scene->decodeFilePath(codedDstPath); dstPath = scene->decodeFilePath(codedDstPath);
} }
@ -1312,7 +1317,7 @@ public:
void execute() override { void execute() override {
static MeshifyPopup *thePopup = 0; static MeshifyPopup *thePopup = 0;
if (!thePopup) thePopup = new MeshifyPopup; if (!thePopup) thePopup = new MeshifyPopup;
thePopup->raise(); thePopup->raise();
thePopup->show(); thePopup->show();