Skip to content

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

C

Fix Clean Up Crash

Abel You7e69e3a6dbdc
diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp
index 6a88aea89..edd4a0d1c 100644
--- a/toonz/sources/toonz/iocommand.cpp
+++ b/toonz/sources/toonz/iocommand.cpp
@@ -1513,8 +1513,11 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) {
#endif
}
+ //In case of a .cln file be loaded into GlobalParemeters,
+ //we should also write these info into .tnz (scene file)
+ // TODO: optimize the GlobalParemeters sturcture
CleanupParameters *cp = scene->getProperties()->getCleanupParameters();
- CleanupParameters oldCP(*cp);
+ //CleanupParameters oldCP(*cp);
cp->assign(&CleanupParameters::GlobalParameters);
// Must wait for current save to finish, just in case
@@ -1531,7 +1534,13 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) {
}
TApp::instance()->setSaveInProgress(false);
- cp->assign(&oldCP);
+ //cp->assign(&oldCP);
+
+ // Make sure that the current cleanup palette is set to currentParams' palette
+ TApp::instance()
+ ->getPaletteController()
+ ->getCurrentCleanupPalette()
+ ->setPalette(cp->m_cleanupPalette.getPointer());
// in case of saving subxsheet, revert the level paths after saving
revertOrgLevelPaths();