Skip to content

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

C

rename xsheet cell with following level (#2199)

shun-iwasawa277d8b90eff1
diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp
index 43186cf94..bd8f1ac52 100644
--- a/toonz/sources/toonz/xshcellviewer.cpp
+++ b/toonz/sources/toonz/xshcellviewer.cpp
@@ -803,6 +803,10 @@ void RenameCellField::renameCell() {
// if there is no level at the current cell, take the level from the
// previous frames
// (when editing not empty column)
+ if (xsheet->isColumnEmpty(c)) {
+ cells.append(TXshCell());
+ continue;
+ }
TXshCell cell;
int tmpRow = m_row;
@@ -811,6 +815,19 @@ void RenameCellField::renameCell() {
if (!cell.isEmpty() || tmpRow == 0) break;
tmpRow--;
}
+
+ // if the level is not found in the previous frames, then search in the
+ // following frames
+ if (cell.isEmpty()) {
+ tmpRow = m_row + 1;
+ int maxFrame = xsheet->getFrameCount();
+ while (1) {
+ cell = xsheet->getCell(tmpRow, c);
+ if (!cell.isEmpty() || tmpRow >= maxFrame) break;
+ tmpRow++;
+ }
+ }
+
TXshLevel *xl = cell.m_level.getPointer();
if (!xl || (xl->getType() == OVL_XSHLEVEL &&
xl->getPath().getFrame() == TFrameId::NO_FRAME)) {