Skip to content

Commit 20df5ad

Browse files
authored
fix overwriting raster drawing palette (#3387)
1 parent 7b05358 commit 20df5ad

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

toonz/sources/include/toonz/fullcolorpalette.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class DVAPI FullColorPalette final : public QObject {
3636
TPalette *getPalette(ToonzScene *scene);
3737
void savePalette(ToonzScene *scene);
3838
bool isFullColorPalette(TPalette *palette) { return m_palette == palette; }
39+
const TFilePath getPath() const { return m_fullcolorPalettePath; }
3940
};
4041

4142
#endif // FULLCOLOR_PALETTE

toonz/sources/toonz/iocommand.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ bool IoCmd::saveLevel(const TFilePath &path) {
15321532
realPath = TFilePath(realPath.getWideString() + ::to_wstring(dotts + ext));
15331533

15341534
bool ret = saveLevel(realPath, sl, false);
1535-
if(!ret){ //save level failed
1535+
if (!ret) { // save level failed
15361536
return false;
15371537
}
15381538

@@ -2948,6 +2948,8 @@ class OverwritePaletteCommandHandler final : public MenuItemHandler {
29482948
}
29492949
if (sl->getPath().getType() == "pli")
29502950
palettePath = sl->getPath();
2951+
else if (sl->getType() & FULLCOLOR_TYPE)
2952+
palettePath = FullColorPalette::instance()->getPath();
29512953
else
29522954
palettePath = sl->getPath().withType("tpl");
29532955
}
@@ -2987,6 +2989,8 @@ class OverwritePaletteCommandHandler final : public MenuItemHandler {
29872989

29882990
if (sl && sl->getPath().getType() == "pli")
29892991
sl->save(palettePath, TFilePath(), true);
2992+
else if (sl->getType() & FULLCOLOR_TYPE)
2993+
FullColorPalette::instance()->savePalette(scene);
29902994
else
29912995
StudioPalette::instance()->save(palettePath, palette);
29922996
/*- Dirtyフラグの変更 -*/

0 commit comments

Comments
 (0)