Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

create zerary fx node at clicked pos (#1191)

shun-iwasawae33f9a51d20e
diff --git a/toonz/sources/toonzqt/addfxcontextmenu.cpp b/toonz/sources/toonzqt/addfxcontextmenu.cpp
index 908455eb7..d968152d5 100644
--- a/toonz/sources/toonzqt/addfxcontextmenu.cpp
+++ b/toonz/sources/toonzqt/addfxcontextmenu.cpp
@@ -15,6 +15,8 @@
#include "toonz/txsheet.h"
#include "toonz/fxdag.h"
#include "toonz/tapplication.h"
+#include "toonz/txshzeraryfxcolumn.h"
+#include "toonz/tcolumnfx.h"
#include "tw/stringtable.h"
// TnzBase includes
@@ -25,6 +27,7 @@
// TnzCore includes
#include "tstream.h"
#include "tsystem.h"
+#include "tconst.h"
// Qt includes
#include <QMenu>
@@ -558,6 +561,18 @@ void AddFxContextMenu::onAddFx(QAction *action) {
m_app->getCurrentColumn()->getColumnIndex(),
m_app->getCurrentFrame()->getFrameIndex());
+ // move the zerary fx node to the clicked position
+ if (fx->isZerary() &&
+ fx->getAttributes()->getDagNodePos() != TConst::nowhere) {
+ TXsheet *xsh = m_app->getCurrentXsheet()->getXsheet();
+ TXshZeraryFxColumn *column =
+ xsh->getColumn(m_app->getCurrentColumn()->getColumnIndex())
+ ->getZeraryFxColumn();
+ if (column)
+ column->getZeraryColumnFx()->getAttributes()->setDagNodePos(
+ fx->getAttributes()->getDagNodePos());
+ }
+
m_app->getCurrentXsheet()->notifyXsheetChanged();
// memorize the latest operation
m_app->getCurrentFx()->setPreviousActionString(QString("A ") +