Skip to content

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

C

Fix deleting output node (part 2)

shun-iwasawabcdd9a1e5292
diff --git a/toonz/sources/include/toonz/fxcommand.h b/toonz/sources/include/toonz/fxcommand.h
index 8f0b25f70..da6559ba1 100644
--- a/toonz/sources/include/toonz/fxcommand.h
+++ b/toonz/sources/include/toonz/fxcommand.h
@@ -72,8 +72,6 @@ DVAPI void unlinkFx(TFx *fx, TFxHandle *fxHandle, TXsheetHandle *xshHandle);
DVAPI void makeMacroFx(const std::vector<TFxP> &fxs, TApplication *app);
DVAPI void explodeMacroFx(TMacroFx *macroFx, TApplication *app);
DVAPI void createOutputFx(TXsheetHandle *xshHandle, TFx *currentFx);
-DVAPI void removeOutputFx(TFx *fx, TXsheetHandle *xshHandle,
- TFxHandle *fxHandle);
DVAPI void makeOutputFxCurrent(TFx *fx, TXsheetHandle *xshHandle);
DVAPI void disconnectNodesFromXsheet(const std::list<TFxP> &fxs,
TXsheetHandle *xshHandle);
diff --git a/toonz/sources/include/toonzqt/fxschematicscene.h b/toonz/sources/include/toonzqt/fxschematicscene.h
index e8c24434f..04662e2c7 100644
--- a/toonz/sources/include/toonzqt/fxschematicscene.h
+++ b/toonz/sources/include/toonzqt/fxschematicscene.h
@@ -213,7 +213,6 @@ protected slots:
void onExplodeMacroFx();
void onOpenMacroFx();
void onSavePresetFx();
- void onRemoveOutput();
void onActivateOutput();
void onPreview();
void onCacheFx();
diff --git a/toonz/sources/toonzlib/fxcommand.cpp b/toonz/sources/toonzlib/fxcommand.cpp
index e30a787b9..72566717c 100644
--- a/toonz/sources/toonzlib/fxcommand.cpp
+++ b/toonz/sources/toonzlib/fxcommand.cpp
@@ -400,7 +400,7 @@ void FxCommandUndo::attach(TXsheet *xsh, const TFxCommand::Link &link,
//------------------------------------------------------
void FxCommandUndo::attachOutputs(TXsheet *xsh, TFx *insertedFx, TFx *inputFx) {
- TCG_ASSERT(inputFx, return );
+ TCG_ASSERT(inputFx, return);
FxDag *fxDag = xsh->getFxDag();
@@ -2349,23 +2349,6 @@ static void deleteFxs(const std::list<TFxP> &fxs, TXsheetHandle *xshHandle,
undoManager->endBlock();
}
-//**********************************************************************
-// Remove Output Fx command
-//**********************************************************************
-
-void TFxCommand::removeOutputFx(TFx *fx, TXsheetHandle *xshHandle,
- TFxHandle *fxHandle) {
- TOutputFx *outputFx = dynamic_cast<TOutputFx *>(fx);
- if (!outputFx) return;
-
- std::unique_ptr<FxCommandUndo> undo(
- new DeleteFxOrColumnUndo(fx, xshHandle, fxHandle));
- if (undo->isConsistent()) {
- undo->redo();
- TUndoManager::manager()->add(undo.release());
- }
-}
-
//**********************************************************************
// Delete Columns command
//**********************************************************************
@@ -3302,7 +3285,7 @@ void UndoConnectFxs::GroupData::restore() const {
void UndoConnectFxs::initialize() {
if (!UndoDisconnectFxs::isConsistent()) return;
- TCG_ASSERT(m_link.m_inputFx && m_link.m_outputFx, m_fxs.clear(); return );
+ TCG_ASSERT(m_link.m_inputFx && m_link.m_outputFx, m_fxs.clear(); return);
// Store sensible original data for the undo
m_undoGroupDatas.reserve(m_fxs.size());
diff --git a/toonz/sources/toonzqt/fxschematicnode.cpp b/toonz/sources/toonzqt/fxschematicnode.cpp
index 7ac57abbd..e3b97071a 100644
--- a/toonz/sources/toonzqt/fxschematicnode.cpp
+++ b/toonz/sources/toonzqt/fxschematicnode.cpp
@@ -1082,7 +1082,7 @@ void FxOutputPainter::contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) {
QMenu menu(fxScene->views()[0]);
if (fxScene->getXsheet()->getFxDag()->getOutputFxCount() > 1) {
QAction *removeOutput = new QAction(tr("&Delete"), &menu);
- connect(removeOutput, SIGNAL(triggered()), fxScene, SLOT(onRemoveOutput()));
+ connect(removeOutput, SIGNAL(triggered()), fxScene, SLOT(onDeleteFx()));
QAction *activateOutput = new QAction(tr("&Activate"), &menu);
connect(activateOutput, SIGNAL(triggered()), fxScene,
@@ -3080,7 +3080,7 @@ FxSchematicColumnNode::FxSchematicColumnNode(FxSchematicScene *scene,
bool ret = true;
ret = ret && connect(m_resizeItem, SIGNAL(toggled(bool)), this,
- SLOT(onChangedSize(bool)));
+ SLOT(onChangedSize(bool)));
ret = ret &&
connect(m_nameItem, SIGNAL(focusOut()), this, SLOT(onNameChanged()));
ret = ret && connect(m_renderToggle, SIGNAL(toggled(bool)), this,
diff --git a/toonz/sources/toonzqt/fxschematicscene.cpp b/toonz/sources/toonzqt/fxschematicscene.cpp
index 308440459..58754098e 100644
--- a/toonz/sources/toonzqt/fxschematicscene.cpp
+++ b/toonz/sources/toonzqt/fxschematicscene.cpp
@@ -1462,12 +1462,6 @@ void FxSchematicScene::onSavePresetFx() {
//------------------------------------------------------------------
-void FxSchematicScene::onRemoveOutput() {
- TFxCommand::removeOutputFx(m_fxHandle->getFx(), m_xshHandle, m_fxHandle);
-}
-
-//------------------------------------------------------------------
-
void FxSchematicScene::onActivateOutput() {
TFxCommand::makeOutputFxCurrent(m_fxHandle->getFx(), m_xshHandle);
}