OpenToonz - An open-source full-featured 2D animation creation software
C
add Save All command
shun_iwasawa0b5f3366ed93
diff --git a/stuff/profiles/layouts/OpenToonz/room1_menubar.xml b/stuff/profiles/layouts/OpenToonz/room1_menubar.xmlindex 13bae2276..373e4b153 100644--- a/stuff/profiles/layouts/OpenToonz/room1_menubar.xml+++ b/stuff/profiles/layouts/OpenToonz/room1_menubar.xml@@ -9,6 +9,7 @@<command>MI_LoadScene</command><command>MI_SaveScene</command><command>MI_SaveSceneAs</command>+ <command>MI_SaveAll</command><command>MI_OpenRecentScene</command><command>MI_RevertScene</command><separator/>diff --git a/stuff/profiles/layouts/OpenToonz/room2_menubar.xml b/stuff/profiles/layouts/OpenToonz/room2_menubar.xmlindex d50330656..64f3972e6 100644--- a/stuff/profiles/layouts/OpenToonz/room2_menubar.xml+++ b/stuff/profiles/layouts/OpenToonz/room2_menubar.xml@@ -16,6 +16,7 @@<command>MI_LoadScene</command><command>MI_SaveScene</command><command>MI_SaveSceneAs</command>+ <command>MI_SaveAll</command><command>MI_OpenRecentScene</command><command>MI_RevertScene</command><separator/>diff --git a/stuff/profiles/layouts/OpenToonz/room3_menubar.xml b/stuff/profiles/layouts/OpenToonz/room3_menubar.xmlindex 6b15f61ed..b0908546f 100644--- a/stuff/profiles/layouts/OpenToonz/room3_menubar.xml+++ b/stuff/profiles/layouts/OpenToonz/room3_menubar.xml@@ -4,6 +4,7 @@<command>MI_LoadFolder</command><command>MI_SaveLevel</command><command>MI_SaveLevelAs</command>+ <command>MI_SaveAll</command><command>MI_OpenRecentLevel</command><command>MI_ExportLevel</command><command>MI_LevelSettings</command>diff --git a/stuff/profiles/layouts/OpenToonz/room4_menubar.xml b/stuff/profiles/layouts/OpenToonz/room4_menubar.xmlindex b37b517f1..544b309eb 100644--- a/stuff/profiles/layouts/OpenToonz/room4_menubar.xml+++ b/stuff/profiles/layouts/OpenToonz/room4_menubar.xml@@ -3,6 +3,7 @@<command>MI_LoadScene</command><command>MI_SaveScene</command><command>MI_SaveSceneAs</command>+ <command>MI_SaveAll</command><command>MI_OpenRecentScene</command><command>MI_RevertScene</command><separator/>diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cppindex 7bddb5a52..a9c34d02b 100644--- a/toonz/sources/toonz/iocommand.cpp+++ b/toonz/sources/toonz/iocommand.cpp@@ -1667,66 +1667,22 @@ bool IoCmd::saveLevel(TXshSimpleLevel *sl)bool IoCmd::saveAll(){-#ifdef BRAVODEMO- return false;-#else// try to save as much as possible// if anything is wrong, return false- bool result = true;- // save scene- if (!saveScene())- {- result = false;- }+ bool result = saveScene();TApp *app = TApp::instance();ToonzScene* scene = app->getCurrentScene()->getScene();- TLevelSet* levelSet = scene->getLevelSet();- int numLevels = levelSet->getLevelCount();- // save levels of scene- for (int i = 0; i < numLevels; ++i)- {- TXshLevel* level = levelSet->getLevel(i);- TXshSimpleLevel *sl = level->getSimpleLevel();- if (sl)- {- if (sl->getPath() == TFilePath())- {- result = false;- continue;- }-- TFilePath path = scene->decodeFilePath(sl->getPath());- if (path == TFilePath())- {- result = false;- continue;- }- if (path.getWideString()[0] == L'+')- {- result = false;- continue;- }- if (!path.isAbsolute())- {- result = false;- continue;- }- if (!saveLevel(path, sl, true))- {- result = false;- continue;- }- sl->setDirtyFlag(false);- }- }-++ SceneResources resources(scene, 0);+ resources.save(scene->getScenePath());+ resources.updatePaths();+// for update title bar- // should we call this for all the levels?- app->getCurrentLevel()->notifyLevelChange();+ app->getCurrentLevel()->notifyLevelTitleChange();+ app->getCurrentPalette()->notifyPaletteTitleChanged();return result;-#endif}//===========================================================================diff --git a/toonz/sources/toonzlib/sceneresources.cpp b/toonz/sources/toonzlib/sceneresources.cppindex 98d3758ac..97ec48cdd 100644--- a/toonz/sources/toonzlib/sceneresources.cpp+++ b/toonz/sources/toonzlib/sceneresources.cpp@@ -256,13 +256,13 @@ void SceneLevel::save()//Questo controllo viene fatto qui e non nella copia o nel salvataggio del livello perche' in generale//non si vuole che il livello unpainted venga copiato con il livello.if (actualFp.getType() == "tlv") {- TFilePath oldUnpaintedLevelPath = oldActualPath.getParentDir() + TFilePath(oldActualPath.getName() + "-unpainted." + oldActualPath.getType());- TFilePath unpaintedLevelPath = actualFp.getParentDir() + TFilePath(actualFp.getName() + "-unpainted." + actualFp.getType());- if (TSystem::doesExistFileOrLevel(oldUnpaintedLevelPath) && !TSystem::doesExistFileOrLevel(unpaintedLevelPath))+ TFilePath oldUnpaintedLevelPath = oldActualPath.getParentDir() + "nopaint\\" + TFilePath(oldActualPath.getName() + "_np." + oldActualPath.getType());+ TFilePath unpaintedLevelPath = actualFp.getParentDir() + "nopaint\\" + TFilePath(actualFp.getName() + "_np." + actualFp.getType());+ if (TSystem::doesExistFileOrLevel(oldUnpaintedLevelPath) && !TSystem::doesExistFileOrLevel(unpaintedLevelPath) && TSystem::touchParentDir(unpaintedLevelPath))TSystem::copyFile(unpaintedLevelPath, oldUnpaintedLevelPath);TFilePath oldUnpaintedPalettePath = oldUnpaintedLevelPath.withType("tpl");TFilePath unpaintedPalettePath = unpaintedLevelPath.withType("tpl");- if (TSystem::doesExistFileOrLevel(oldUnpaintedPalettePath) && !TSystem::doesExistFileOrLevel(unpaintedPalettePath))+ if (TSystem::doesExistFileOrLevel(oldUnpaintedPalettePath) && !TSystem::doesExistFileOrLevel(unpaintedPalettePath) && TSystem::touchParentDir(unpaintedPalettePath))TSystem::copyFile(unpaintedPalettePath, oldUnpaintedPalettePath);}} catch (...) {