Skip to content

Commit

Permalink
Merge pull request #3336 from shun-iwasawa/fix_pegbar_lost_on_explodi…
Browse files Browse the repository at this point in the history
…ng_subxsheet

Fix pegbar lost on exploding sub xsheet
  • Loading branch information
RodneyBaker committed Jun 9, 2020
2 parents 6dbaee3 + faa4917 commit e6e7686
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions toonz/sources/toonz/subscenecommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,11 @@ void bringObjectOut(TStageObject *obj, TXsheet *xsh,
assert(id.isPegbar());
pegbarIndex++;
TStageObjectId outerId = TStageObjectId::PegbarId(pegbarIndex);
// find the first available pegbar id
while (xsh->getStageObjectTree()->getStageObject(outerId, false)) {
pegbarIndex++;
outerId = TStageObjectId::PegbarId(pegbarIndex);
}
TStageObject *outerObj =
xsh->getStageObjectTree()->getStageObject(outerId, true);
outerObj->setDagNodePos((*it)->getDagNodePos());
Expand Down Expand Up @@ -600,8 +605,8 @@ set<int> explodeStageObjects(
if (!onlyColumn) {
// add a pegbar to represent the table
TStageObject *table = subXsh->getStageObject(TStageObjectId::TableId);
/*- 空いてるIndexまでpegbarIndexを進める -*/
int pegbarIndex = 2;
// find the first available pegbar index
int pegbarIndex = 0;
while (
outerTree->getStageObject(TStageObjectId::PegbarId(pegbarIndex), false))
pegbarIndex++;
Expand Down

0 comments on commit e6e7686

Please sign in to comment.