OpenToonz - An open-source full-featured 2D animation creation software
C
fix psd loading and level format preferences
shun-iwasawaeeca9fd070b1
diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cppindex b3d5c82df..5201529d5 100644--- a/toonz/sources/toonz/iocommand.cpp+++ b/toonz/sources/toonz/iocommand.cpp@@ -2253,7 +2253,7 @@ static int loadPSDResource(IoCmd::LoadResourceArguments &args,assert(childLevel);childXsh = childLevel->getXsheet();}- int subCol0 = args.col0;+ int subCol0 = 0;loadedPsdLevelIndex.clear();// for each layer in psdfor (int i = 0; i < popup->getPsdLevelCount(); i++) {@@ -2265,7 +2265,7 @@ static int loadPSDResource(IoCmd::LoadResourceArguments &args,count +=createSubXSheetFromPSDFolder(args, childXsh, subCol0, i, popup);else- count += createSubXSheetFromPSDFolder(args, xsh, subCol0, i, popup);+ count += createSubXSheetFromPSDFolder(args, xsh, col0, i, popup);} else {TFilePath psdpath = popup->getPsdPath(i);TXshLevel *xl = 0;@@ -2280,14 +2280,14 @@ static int loadPSDResource(IoCmd::LoadResourceArguments &args,// lo importo nell'xsheetif (popup->subxsheet() && childXsh) {childXsh->exposeLevel(0, subCol0, xl);+ subCol0++;+ } else {+ // move the current column to the right+ col0++;+ app->getCurrentColumn()->setColumnIndex(col0);}args.loadedLevels.push_back(xl);- subCol0++;count++;-- // move the current column to the right- col0++;- app->getCurrentColumn()->setColumnIndex(col0);}}}diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cppindex 91b1de373..bd021743f 100644--- a/toonz/sources/toonzlib/preferences.cpp+++ b/toonz/sources/toonzlib/preferences.cpp@@ -94,7 +94,7 @@ inline bool formatLess(const Preferences::LevelFormat &a,//=================================================================void getDefaultLevelFormats(LevelFormatVector &lfv) {- lfv.resize(3);+ lfv.resize(2);{LevelFormat &lf = lfv[0];@@ -215,6 +215,13 @@ void getValue(QSettings &settings,++it;}changed = true;+ }+ // remove the "empty" condition which may inserted due to the previous bug+ else if ((*it).m_name.isEmpty() &&+ (*it).m_pathFormat == QRegExp(".*", Qt::CaseInsensitive) &&+ (*it).m_priority == 1 && (*it).m_options == LevelOptions()) {+ it = lfv.erase(it);+ changed = true;} else++it;}