Skip to content

Commit

Permalink
Merge branch 'master' from opentoonz
Browse files Browse the repository at this point in the history
  • Loading branch information
manongjohn committed Nov 2, 2020
2 parents ec1ecaf + f133299 commit a474e78
Show file tree
Hide file tree
Showing 168 changed files with 3,519 additions and 941 deletions.
4 changes: 2 additions & 2 deletions stuff/config/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,8 @@

<!------------------------------ Function Editor ------------------------------------------->

<item>W_NS "N/S" </item>
<item>W_EW "E/W" </item>
<item>W_Y "Y" </item>
<item>W_X "X" </item>
<item>W_Z "Z" </item>
<item>W_SO "SO" </item>
<item>W_Rotation "Rotation" </item>
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Blue/Blue.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: #995d1d;
qproperty-KeyFrameBorderColor: #db9041;
qproperty-SelectedKeyFrameColor: #a2835b;
qproperty-IgnoredKeyFrameColor: #ac2a39;
qproperty-SelectedIgnoredKeyFrameColor: #b25872;
qproperty-InBetweenColor: #666250;
qproperty-InBetweenBorderColor: #b0aa91;
qproperty-SelectedInBetweenColor: #717970;
qproperty-IgnoredInBetweenColor: #8a695e;
qproperty-SelectedIgnoredInBetweenColor: #93807d;
qproperty-SelectedEmptyColor: rgba(96, 109, 118, 0.5);
qproperty-SelectedSceneRangeEmptyColor: rgba(96, 109, 118, 0.5);
qproperty-TextColor: #d6d8dd;
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Dark/Dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: #995d1d;
qproperty-KeyFrameBorderColor: #db9041;
qproperty-SelectedKeyFrameColor: #a2835b;
qproperty-IgnoredKeyFrameColor: #ac2a39;
qproperty-SelectedIgnoredKeyFrameColor: #b25872;
qproperty-InBetweenColor: #666250;
qproperty-InBetweenBorderColor: #b0aa91;
qproperty-SelectedInBetweenColor: #717970;
qproperty-IgnoredInBetweenColor: #8a695e;
qproperty-SelectedIgnoredInBetweenColor: #93807d;
qproperty-SelectedEmptyColor: rgba(90, 100, 106, 0.5);
qproperty-SelectedSceneRangeEmptyColor: rgba(90, 100, 106, 0.5);
qproperty-TextColor: #e6e6e6;
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Default/Default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: #995d1d;
qproperty-KeyFrameBorderColor: #db9041;
qproperty-SelectedKeyFrameColor: #a2835b;
qproperty-IgnoredKeyFrameColor: #ac2a39;
qproperty-SelectedIgnoredKeyFrameColor: #b25872;
qproperty-InBetweenColor: #666250;
qproperty-InBetweenBorderColor: #b0aa91;
qproperty-SelectedInBetweenColor: #717970;
qproperty-IgnoredInBetweenColor: #8a695e;
qproperty-SelectedIgnoredInBetweenColor: #93807d;
qproperty-SelectedEmptyColor: rgba(103, 113, 119, 0.5);
qproperty-SelectedSceneRangeEmptyColor: rgba(103, 113, 119, 0.5);
qproperty-TextColor: #e6e6e6;
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Default/less/Default.less
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,13 @@
@function-KeyFrame-color: darken(desaturate(spin(@keyframe-total-color, 0.0000), 0.7570), 8.4314);
@function-KeyFrameBorder-color: lighten(@function-KeyFrame-color, 20);
@function-SelectedKeyFrame-color: mix(shade(@function-KeyFrame-color, -40), @cellHighlightTintColor, 60);
@function-IgnoredKeyFrame-color: rgb(172,42,57);
@function-SelectedIgnoredKeyFrame-color: mix(shade(@function-IgnoredKeyFrame-color, -40), @cellHighlightTintColor, 60);
@function-Inbetween-color: darken(desaturate(spin(@keyframe-inbetween-color, 0.4423), 4.8071), 7.2549);
@function-InbetweenBorder-color: lighten(@keyframe-inbetween-color, 20);
@function-SelectedInbetween-color: mix(shade(@function-Inbetween-color, @cellHighlightLightness), @cellHighlightTintColor, @cellHighlightTintAmount);
@function-IgnoredInbetween-color: rgb(138,105,94);
@function-SelectedIgnoredInbetween-color: mix(shade(@function-IgnoredInbetween-color, @cellHighlightLightness), @cellHighlightTintColor, @cellHighlightTintAmount);

// Expression Field
@function-ExpressionFieldBG-color: lighten(@bg, 61.9608);
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Default/less/layouts/xsheet.less
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: @function-KeyFrame-color;
qproperty-KeyFrameBorderColor: @function-KeyFrameBorder-color;
qproperty-SelectedKeyFrameColor: @function-SelectedKeyFrame-color;
qproperty-IgnoredKeyFrameColor: @function-IgnoredKeyFrame-color;
qproperty-SelectedIgnoredKeyFrameColor: @function-SelectedIgnoredKeyFrame-color;
qproperty-InBetweenColor: @function-Inbetween-color;
qproperty-InBetweenBorderColor: @function-InbetweenBorder-color;
qproperty-SelectedInBetweenColor: @function-SelectedInbetween-color;
qproperty-IgnoredInBetweenColor: @function-IgnoredInbetween-color;
qproperty-SelectedIgnoredInBetweenColor: @function-SelectedIgnoredInbetween-color;
qproperty-SelectedEmptyColor: @xsheet-SelectedEmptyCell-color; // paired
qproperty-SelectedSceneRangeEmptyColor: @function-SelectedSceneRangeEmpty-color;
qproperty-TextColor: @xsheet-text-color; // paired
Expand Down
3 changes: 3 additions & 0 deletions stuff/config/qss/Default/less/themes/Light.less
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@
@function-panel-bg-color: @schematic-viewer-bg-color;
@function-panel-OtherCurves-color: rgb(218, 218, 218);
@function-panel-Text-color: @text-color;

@function-panel-Sub-color: #fff;
@function-panel-Selected-color: #ffe033;
@function-IgnoredKeyFrame-color: rgb(203,87,101);
@function-IgnoredInbetween-color: rgb(194,156,146);

@function-SelectedKeyFrame-color: mix(shade(@function-KeyFrame-color, @cellHighlightLightness), @cellHighlightTintColor, @cellHighlightTintAmount);
4 changes: 4 additions & 0 deletions stuff/config/qss/Light/Light.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: #edaa64;
qproperty-KeyFrameBorderColor: #bb6a16;
qproperty-SelectedKeyFrameColor: #c9a278;
qproperty-IgnoredKeyFrameColor: #cb5765;
qproperty-SelectedIgnoredKeyFrameColor: #eb96ad;
qproperty-InBetweenColor: #e2dbcc;
qproperty-InBetweenBorderColor: #ac9f82;
qproperty-SelectedInBetweenColor: #c2c4c0;
qproperty-IgnoredInBetweenColor: #c29c92;
qproperty-SelectedIgnoredInBetweenColor: #ab9898;
qproperty-SelectedEmptyColor: rgba(146, 153, 158, 0.5);
qproperty-SelectedSceneRangeEmptyColor: rgba(146, 153, 158, 0.5);
qproperty-TextColor: #000;
Expand Down
4 changes: 4 additions & 0 deletions stuff/config/qss/Neutral/Neutral.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,13 @@ SpreadsheetViewer {
qproperty-KeyFrameColor: #c4833e;
qproperty-KeyFrameBorderColor: #64421f;
qproperty-SelectedKeyFrameColor: #deae7b;
qproperty-IgnoredKeyFrameColor: #ac2a39;
qproperty-SelectedIgnoredKeyFrameColor: #ca6377;
qproperty-InBetweenColor: #b4b09e;
qproperty-InBetweenBorderColor: #6e6c64;
qproperty-SelectedInBetweenColor: #c7c7bb;
qproperty-IgnoredInBetweenColor: #8a695e;
qproperty-SelectedIgnoredInBetweenColor: #a08680;
qproperty-SelectedEmptyColor: rgba(155, 159, 162, 0.5);
qproperty-SelectedSceneRangeEmptyColor: rgba(155, 159, 162, 0.5);
qproperty-TextColor: #000;
Expand Down
2 changes: 1 addition & 1 deletion toonz/sources/colorfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_definitions(
)

if(BUILD_ENV_APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-install_name,@rpath/libcolorfx.dylib")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-install_name,@rpath/libcolorfx.dylib")
add_dependencies(colorfx tnzcore tnzbase)
endif()

Expand Down
18 changes: 12 additions & 6 deletions toonz/sources/common/expressions/texpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class TExpression::Imp {
m_errorPos; //!< Position of the error in the expression's text

bool m_isValid, //!< Whether the expression is valid
m_hasBeenParsed; //!< Whether the expression has already been parsed
m_hasBeenParsed, //!< Whether the expression has already been parsed
m_hasReference;

public:
Imp()
Expand All @@ -35,7 +36,8 @@ class TExpression::Imp {
, m_calculator(0)
, m_errorPos(0, -1)
, m_isValid(false)
, m_hasBeenParsed(true) {}
, m_hasBeenParsed(true)
, m_hasReference(false) {}
~Imp() { delete m_calculator; }
};

Expand All @@ -60,6 +62,7 @@ TExpression::TExpression(const TExpression &src) : m_imp(new Imp()) {
m_imp->m_error = src.m_imp->m_error;
m_imp->m_errorPos = src.m_imp->m_errorPos;
m_imp->m_hasBeenParsed = false;
m_imp->m_hasReference = src.m_imp->m_hasReference;
}

//--------------------------------------------------------------------------
Expand All @@ -85,11 +88,12 @@ const TSyntax::Grammar *TExpression::getGrammar() const {
//--------------------------------------------------------------------------

void TExpression::setText(std::string text) {
if (m_imp->m_text != text) {
if (m_imp->m_text != text || m_imp->m_hasReference) {
m_imp->m_text = text;
delete m_imp->m_calculator;
m_imp->m_calculator = 0;
m_imp->m_isValid = false;
m_imp->m_hasReference = false;
m_imp->m_hasBeenParsed = false;
m_imp->m_error = "";
m_imp->m_errorPos = std::make_pair(0, -1);
Expand Down Expand Up @@ -142,8 +146,9 @@ void TExpression::parse() {
delete m_imp->m_calculator;
m_imp->m_calculator = 0;

m_imp->m_errorPos = std::make_pair(0, -1);
m_imp->m_error = std::string();
m_imp->m_errorPos = std::make_pair(0, -1);
m_imp->m_error = std::string();
m_imp->m_hasReference = false;

if (!m_imp->m_grammar) {
m_imp->m_error = "No grammar defined";
Expand All @@ -156,7 +161,8 @@ void TExpression::parse() {
if (m_imp->m_calculator)
m_imp->m_calculator->setOwnerParameter(m_imp->m_param);

m_imp->m_isValid = parser.isValid();
m_imp->m_isValid = parser.isValid();
m_imp->m_hasReference = parser.hasReference();

if (!m_imp->m_isValid) {
m_imp->m_error = parser.getError();
Expand Down
26 changes: 21 additions & 5 deletions toonz/sources/common/expressions/tparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ class Parser::Imp {
std::vector<SyntaxToken> m_syntaxTokens;
Grammar::Position m_position;
// Pattern *m_lastPattern;
bool m_hasReference;

Imp(const Grammar *grammar)
: m_grammar(grammar)
, m_errorString("")
, m_isValid(false)
, m_calculator(0)
, m_position(Grammar::ExpressionStart) {}
, m_position(Grammar::ExpressionStart)
, m_hasReference(false) {}
~Imp() {
clearPointerContainer(m_nodeStack);
delete m_calculator;
Expand Down Expand Up @@ -235,14 +237,24 @@ bool Parser::Imp::parseExpression(bool checkOnly) {
Calculator *Parser::parse(std::string text) {
m_imp->m_tokenizer.setBuffer(text);
clearPointerContainer(m_imp->m_nodeStack);
m_imp->m_errorString = "";
m_imp->m_isValid = false;
m_imp->m_calculator = new Calculator();
bool ret = m_imp->parseExpression(false);
m_imp->m_errorString = "";
m_imp->m_isValid = false;
m_imp->m_hasReference = false;
m_imp->m_calculator = new Calculator();
bool ret = m_imp->parseExpression(false);
if (ret && !m_imp->m_nodeStack.empty()) {
m_imp->m_calculator->setRootNode(m_imp->m_nodeStack.back());

for (auto node : m_imp->m_nodeStack) {
if (node->hasReference()) {
m_imp->m_hasReference = true;
break;
}
}

m_imp->m_nodeStack.pop_back();
m_imp->m_isValid = true;

} else {
delete m_imp->m_calculator;
m_imp->m_calculator = 0;
Expand Down Expand Up @@ -306,6 +318,10 @@ bool Parser::isValid() const { return m_imp->m_isValid; }

//-------------------------------------------------------------------

bool Parser::hasReference() const { return m_imp->m_hasReference; }

//-------------------------------------------------------------------

std::string Parser::getText() const { return m_imp->m_tokenizer.getBuffer(); }

//-------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions toonz/sources/common/tcore/tthread_nt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#define _WIN32_WINNT 0x0400
#include <windows.h>

using std::list<TThread *>;

class TThreadGroupImp;
//---------------------------------------------------------------------------
// TMutex & TMutexImp
Expand All @@ -24,7 +22,7 @@ class TMutexImp {
//---------------------------------------------------------------------------

class TThreadGroupImp {
list<TThread *> threads;
std::list<TThread *> threads;

public:
TThreadGroupImp();
Expand Down Expand Up @@ -274,7 +272,7 @@ void TThreadGroupImp::wait() {
if (count == 0) return;
HANDLE *hThreads = new HANDLE[count];
int id = 0;
for (list<TThread *>::iterator it = threads.begin(); it != threads.end();
for (std::list<TThread *>::iterator it = threads.begin(); it != threads.end();
it++, id++) {
TThread *t = *it;
if (t->m_imp->threadId == 0) t->start();
Expand Down
16 changes: 7 additions & 9 deletions toonz/sources/common/tcore/tundo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

//-----------------------------------------------------------------------------

using std::for_each;

namespace {

void deleteUndo(const TUndo *undo) { delete undo; }
Expand All @@ -26,7 +24,7 @@ class TUndoBlock final : public TUndo {
assert(m_undoing == false);
assert(m_deleted == false);
m_deleted = true;
for_each(m_undos.begin(), m_undos.end(), deleteUndo);
std::for_each(m_undos.begin(), m_undos.end(), deleteUndo);
m_undos.clear();
}

Expand All @@ -49,15 +47,15 @@ class TUndoBlock final : public TUndo {
assert(!m_undoing);
m_undoing = true;
// VERSIONE CORRETTA
for_each(m_undos.rbegin(), m_undos.rend(), callUndo);
std::for_each(m_undos.rbegin(), m_undos.rend(), callUndo);
// VERSIONE SBAGLIATA
// for_each(m_undos.begin(), m_undos.end(), callUndo);
m_undoing = false;
}
void redo() const override {
assert(!m_deleted);
// VERSIONE CORRETTA
for_each(m_undos.begin(), m_undos.end(), callRedo);
std::for_each(m_undos.begin(), m_undos.end(), callRedo);
// VERSIONE SBAGLIATA
// for_each(m_undos.rbegin(), m_undos.rend(), callRedo);
}
Expand Down Expand Up @@ -181,7 +179,7 @@ void TUndoManager::TUndoManagerImp::add(TUndo *undo) {

void TUndoManager::TUndoManagerImp::doAdd(TUndo *undo) {
if (m_current != m_undoList.end()) {
for_each(m_current, m_undoList.end(), deleteUndo);
std::for_each(m_current, m_undoList.end(), deleteUndo);
m_undoList.erase(m_current, m_undoList.end());
}

Expand All @@ -208,7 +206,7 @@ void TUndoManager::TUndoManagerImp::doAdd(TUndo *undo) {

void TUndoManager::beginBlock() {
if (m_imp->m_current != m_imp->m_undoList.end()) {
for_each(m_imp->m_current, m_imp->m_undoList.end(), deleteUndo);
std::for_each(m_imp->m_current, m_imp->m_undoList.end(), deleteUndo);
m_imp->m_undoList.erase(m_imp->m_current, m_imp->m_undoList.end());
}

Expand Down Expand Up @@ -315,7 +313,7 @@ void TUndoManager::reset() {
assert(m_imp->m_blockStack.empty());
m_imp->m_blockStack.clear();
UndoList &lst = m_imp->m_undoList;
for_each(lst.begin(), lst.end(), deleteUndo);
std::for_each(lst.begin(), lst.end(), deleteUndo);
lst.clear();
m_imp->m_current = m_imp->m_undoList.end();
Q_EMIT historyChanged();
Expand Down Expand Up @@ -380,7 +378,7 @@ void TUndoManager::popUndo(int n, bool forward) {
i++;
}
}
for_each(start, end, deleteUndo);
std::for_each(start, end, deleteUndo);
m_imp->m_undoList.erase(start, end);
m_imp->m_current = m_imp->m_undoList.end();
} else
Expand Down
9 changes: 4 additions & 5 deletions toonz/sources/common/tfx/tfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,11 +873,10 @@ void TFx::saveData(TOStream &os) {
}

os.openChild("ports");
for (PortTable::iterator pit = m_imp->m_portTable.begin();
pit != m_imp->m_portTable.end(); ++pit) {
os.openChild(pit->first);
if (pit->second->isConnected())
os << TFxP(pit->second->getFx()).getPointer();
for (auto &namePort : m_imp->m_portArray) {
os.openChild(namePort.first);
if (namePort.second->isConnected())
os << TFxP(namePort.second->getFx()).getPointer();
os.closeChild();
}
os.closeChild();
Expand Down
3 changes: 0 additions & 3 deletions toonz/sources/common/tio.cpp

This file was deleted.

Loading

0 comments on commit a474e78

Please sign in to comment.