From 6f36231342126b9b0c87595805551c2b20d903ed Mon Sep 17 00:00:00 2001 From: Rodney Date: Dec 06 2019 14:50:08 +0000 Subject: Merge pull request #2911 from manongjohn/fix_palette_zerary_col_tool_crashes Fix tool crashes on Palette and Zerary column --- diff --git a/toonz/sources/tnztools/tool.cpp b/toonz/sources/tnztools/tool.cpp index a1eafe9..461ceb3 100644 --- a/toonz/sources/tnztools/tool.cpp +++ b/toonz/sources/tnztools/tool.cpp @@ -875,6 +875,12 @@ QString TTool::updateEnabled(int rowIndex, int columnIndex) { m_application->getCurrentObject()->getObjectId().getIndex()); } + bool isZeraryCol = + column ? (column->getZeraryFxColumn() ? true : false) : false; + bool isPaletteCol = + column ? (column->getPaletteColumn() ? true : false) : false; + bool isMeshCol = column ? (column->getMeshColumn() ? true : false) : false; + // Check against splines if (spline && (toolType & TTool::LevelTool)) { return (targetType & Splines) @@ -930,8 +936,10 @@ QString TTool::updateEnabled(int rowIndex, int columnIndex) { if (toolType & TTool::LevelTool) { // Check against empty levels if (!xl) - return (targetType & EmptyTarget) ? (enable(true), QString()) - : (enable(false), QString()); + return ((targetType & EmptyTarget) && !isZeraryCol && !isPaletteCol && + !isMeshCol) + ? (enable(true), QString()) + : (enable(false), QString()); // Check against simple-level-edness if (!sl)