OpenToonz - An open-source full-featured 2D animation creation software
C
#assistants: improve track preview
Ivan Mahonindba7b5852528
diff --git a/toonz/sources/include/tools/inputmanager.h b/toonz/sources/include/tools/inputmanager.hindex 36bf4fe57..7d9a58d28 100644--- a/toonz/sources/include/tools/inputmanager.h+++ b/toonz/sources/include/tools/inputmanager.h@@ -282,6 +282,7 @@ private:public:TInputState state;+ bool drawPreview;public:diff --git a/toonz/sources/tnztools/assistant.cpp b/toonz/sources/tnztools/assistant.cppindex 68aa2b0c0..25f9d13a2 100644--- a/toonz/sources/tnztools/assistant.cpp+++ b/toonz/sources/tnztools/assistant.cpp@@ -25,13 +25,13 @@ TGuideline::drawSegment(bool active,bool enabled ) const{- double colorBlack[4] = { 0.0, 0.0, 0.0, 0.5 };- double colorWhite[4] = { 1.0, 1.0, 1.0, 0.5 };+ double colorBlack[4] = { 0.0, 0.0, 0.0, 0.25 };+ double colorWhite[4] = { 1.0, 1.0, 1.0, 0.25 };if (!this->enabled || !enabled)- colorBlack[3] = (colorWhite[3] = 0.25);- else if (!active)- colorBlack[3] = (colorWhite[3] = 0.75);+ colorBlack[3] = (colorWhite[3] = 0.125);+ else if (active)+ colorBlack[3] = (colorWhite[3] = 0.5);glPushAttrib(GL_ALL_ATTRIB_BITS);tglEnableBlending();diff --git a/toonz/sources/tnztools/fullcolorbrushtool.cpp b/toonz/sources/tnztools/fullcolorbrushtool.cppindex 0ce8f2d1d..08f2d39b9 100644--- a/toonz/sources/tnztools/fullcolorbrushtool.cpp+++ b/toonz/sources/tnztools/fullcolorbrushtool.cpp@@ -287,6 +287,7 @@ bool FullColorBrushTool::askWrite(const TRect &rect) {bool FullColorBrushTool::preLeftButtonDown() {m_modifierAssistants->drawOnly = !FullcolorAssistants;+ m_inputmanager.drawPreview = !m_modifierAssistants->drawOnly;m_inputmanager.clearModifiers();m_inputmanager.addModifier( TInputModifierP(m_modifierTangents.getPointer()) );@@ -319,6 +320,7 @@ void FullColorBrushTool::handleMouseEvent(MouseEventType type, const TPointD &pom_inputmanager.clearModifiers();m_inputmanager.addModifier( TInputModifierP(m_modifierLine.getPointer()) );m_inputmanager.addModifier( TInputModifierP(m_modifierSegmentation.getPointer()) );+ m_inputmanager.drawPreview = true;}if (alt != m_inputmanager.state.isKeyPressed(TKey::alt))diff --git a/toonz/sources/tnztools/inputmanager.cpp b/toonz/sources/tnztools/inputmanager.cppindex bc0dc9ead..bc00bb992 100644--- a/toonz/sources/tnztools/inputmanager.cpp+++ b/toonz/sources/tnztools/inputmanager.cpp@@ -205,7 +205,8 @@ TInputManager::TInputManager():m_tracks(1),m_hovers(1),m_started(),- m_savePointsSent()+ m_savePointsSent(),+ drawPreview(){ }@@ -685,10 +686,10 @@ TInputManager::draw() {m_nextBounds = TRectD();// paint not sent sub-tracks- if (debugInputManager /* || m_savePointsSent < (int)m_savePoints.size() */) {+ if ( debugInputManager || (drawPreview && m_savePointsSent < (int)m_savePoints.size()) ) {glPushAttrib(GL_ALL_ATTRIB_BITS);tglEnableBlending();- tglEnableLineSmooth(true, 0.5);+ tglEnableLineSmooth(true, 1.0);double pixelSize = sqrt(tglGetPixelSize2());double colorBlack[4] = { 0.0, 0.0, 0.0, 1.0 };double colorWhite[4] = { 1.0, 1.0, 1.0, 1.0 };@@ -698,12 +699,12 @@ TInputManager::draw() {int start = debugInputManager ? 0 : handler->saves[m_savePointsSent] - 1;if (start < 0) start = 0;if (start + 1 < track.size()) {- int level = m_savePointsSent;- colorBlack[3] = (colorWhite[3] = 0.8);+ //int level = m_savePointsSent;+ //colorBlack[3] = (colorWhite[3] = 0.8);double radius = 2.0;for(int i = start + 1; i < track.size(); ++i) {- while(level < (int)handler->saves.size() && handler->saves[level] <= i)- colorBlack[3] = (colorWhite[3] *= 0.8), ++level;+ //while(level < (int)handler->saves.size() && handler->saves[level] <= i)+ // colorBlack[3] = (colorWhite[3] *= 0.8), ++level;const TPointD &a = track[i-1].position;const TPointD &b = track[i].position;