OpenToonz - An open-source full-featured 2D animation creation software
C
fix frameIds inconsistency in level strip commands
shun-iwasawaeb1fdc547a46
diff --git a/toonz/sources/toonz/filmstripcommand.cpp b/toonz/sources/toonz/filmstripcommand.cppindex 04dbd7825..f7a73675a 100644--- a/toonz/sources/toonz/filmstripcommand.cpp+++ b/toonz/sources/toonz/filmstripcommand.cpp@@ -48,7 +48,8 @@//=============================================================================TFrameId operator+(const TFrameId &fid, int d) {- return TFrameId(fid.getNumber() + d, fid.getLetter());+ return TFrameId(fid.getNumber() + d, fid.getLetter(), fid.getZeroPadding(),+ fid.getStartSeqInd());}//-----------------------------------------------------------------------------@@ -1255,10 +1256,14 @@ void FilmstripCmd::addFrames(TXshSimpleLevel *sl, int start, int end,std::vector<TFrameId> oldFids;sl->getFids(oldFids);+ TFrameId tmplFid;+ if (!oldFids.empty()) tmplFid = oldFids.front();+std::set<TFrameId> fidsToInsert;int frame = 0;for (frame = start; frame <= end; frame += step)- fidsToInsert.insert(TFrameId(frame));+ fidsToInsert.insert(TFrameId(frame, "", tmplFid.getZeroPadding(),+ tmplFid.getStartSeqInd()));makeSpaceForFids(sl, fidsToInsert);@@ -1398,7 +1403,8 @@ void FilmstripCmd::renumber(if (tmp.count(tarFid) > 0) {do {tarFid =- TFrameId(tarFid.getNumber(), getNextLetter(tarFid.getLetter()));+ TFrameId(tarFid.getNumber(), getNextLetter(tarFid.getLetter()),+ tarFid.getZeroPadding(), tarFid.getStartSeqInd());} while (!tarFid.getLetter().isEmpty() && tmp.count(tarFid) > 0);if (tarFid.getLetter().isEmpty()) {// todo: error message@@ -1456,7 +1462,8 @@ void FilmstripCmd::renumber(TXshSimpleLevel *sl, std::set<TFrameId> &frames,std::vector<TFrameId>::iterator j = fids.begin();for (it = frames.begin(); it != frames.end(); ++it) {TFrameId srcFid(*it);- TFrameId dstFid(frame);+ TFrameId dstFid(frame, "", srcFid.getZeroPadding(),+ srcFid.getStartSeqInd());frame += stepFrame;// faccio il controllo su tmp e non su fids. considera:// fids = [1,2,3,4], renumber = [2->3,3->5]@@ -1489,7 +1496,8 @@ void FilmstripCmd::renumber(TXshSimpleLevel *sl, std::set<TFrameId> &frames,it2 = frames.begin();std::set<TFrameId> newFrames;for (i = 0; i < frames.size(); i++, it2++)- newFrames.insert(TFrameId(startFrame + (i * stepFrame), it2->getLetter()));+ newFrames.insert(TFrameId(startFrame + (i * stepFrame), it2->getLetter(),+ it2->getZeroPadding(), it2->getStartSeqInd()));assert(frames.size() == newFrames.size());frames.swap(newFrames);