diff --git a/app/node/graph.cpp b/app/node/graph.cpp index 53fb04e51..a2d04b233 100644 --- a/app/node/graph.cpp +++ b/app/node/graph.cpp @@ -95,10 +95,10 @@ void NodeGraph::childEvent(QChildEvent *event) node_children_.append(node); // Connect signals - connect(node, &Node::InputConnected, this, &NodeGraph::InputConnected); - connect(node, &Node::InputDisconnected, this, &NodeGraph::InputDisconnected); - connect(node, &Node::ValueChanged, this, &NodeGraph::ValueChanged); - connect(node, &Node::InputValueHintChanged, this, &NodeGraph::InputValueHintChanged); + connect(node, &Node::InputConnected, this, &NodeGraph::InputConnected, Qt::DirectConnection); + connect(node, &Node::InputDisconnected, this, &NodeGraph::InputDisconnected, Qt::DirectConnection); + connect(node, &Node::ValueChanged, this, &NodeGraph::ValueChanged, Qt::DirectConnection); + connect(node, &Node::InputValueHintChanged, this, &NodeGraph::InputValueHintChanged, Qt::DirectConnection); emit NodeAdded(node); emit node->AddedToGraph(this); diff --git a/app/render/previewautocacher.cpp b/app/render/previewautocacher.cpp index 945eab6f8..45c5483b1 100644 --- a/app/render/previewautocacher.cpp +++ b/app/render/previewautocacher.cpp @@ -887,12 +887,12 @@ void PreviewAutoCacher::SetViewerNode(ViewerOutput *viewer_node) UpdateLastSyncedValue(); // Connect signals for future node additions/deletions - connect(graph, &NodeGraph::NodeAdded, this, &PreviewAutoCacher::NodeAdded); - connect(graph, &NodeGraph::NodeRemoved, this, &PreviewAutoCacher::NodeRemoved); - connect(graph, &NodeGraph::InputConnected, this, &PreviewAutoCacher::EdgeAdded); - connect(graph, &NodeGraph::InputDisconnected, this, &PreviewAutoCacher::EdgeRemoved); - connect(graph, &NodeGraph::ValueChanged, this, &PreviewAutoCacher::ValueChanged); - connect(graph, &NodeGraph::InputValueHintChanged, this, &PreviewAutoCacher::ValueHintChanged); + connect(graph, &NodeGraph::NodeAdded, this, &PreviewAutoCacher::NodeAdded, Qt::DirectConnection); + connect(graph, &NodeGraph::NodeRemoved, this, &PreviewAutoCacher::NodeRemoved, Qt::DirectConnection); + connect(graph, &NodeGraph::InputConnected, this, &PreviewAutoCacher::EdgeAdded, Qt::DirectConnection); + connect(graph, &NodeGraph::InputDisconnected, this, &PreviewAutoCacher::EdgeRemoved, Qt::DirectConnection); + connect(graph, &NodeGraph::ValueChanged, this, &PreviewAutoCacher::ValueChanged, Qt::DirectConnection); + connect(graph, &NodeGraph::InputValueHintChanged, this, &PreviewAutoCacher::ValueHintChanged, Qt::DirectConnection); connect(viewer_node_, &ViewerOutput::VideoAutoCacheChanged, diff --git a/app/widget/nodeview/nodeview.cpp b/app/widget/nodeview/nodeview.cpp index c4155ab8e..2f72419fd 100644 --- a/app/widget/nodeview/nodeview.cpp +++ b/app/widget/nodeview/nodeview.cpp @@ -980,6 +980,13 @@ void NodeView::OpenSelectedNodeInViewer() void NodeView::RemoveNode(Node *node) { + for (auto it=attached_items_.begin(); it!=attached_items_.end(); ) { + if (it->item->GetNode() == node) { + it = attached_items_.erase(it); + } else { + it++; + } + } for (const Node::OutputConnection &oc : node->output_connections()) { scene_.RemoveEdge(oc.first, oc.second); } diff --git a/app/widget/timelinewidget/tool/pointer.cpp b/app/widget/timelinewidget/tool/pointer.cpp index 3ae226ee0..1ea1ba703 100644 --- a/app/widget/timelinewidget/tool/pointer.cpp +++ b/app/widget/timelinewidget/tool/pointer.cpp @@ -721,10 +721,13 @@ void PointerTool::InitiateDrag(Block *clicked_item, TimelineViewGhostItem* PointerTool::AddGhostFromBlock(Block* block, Timeline::MovementMode mode, bool check_if_exists) { - if (!block) { + // Ignore null blocks or blocks that aren't attached to a track because there's nothing we can + // do with either of those + if (!block || !block->track()) { return nullptr; } + // Check if we've already made a ghost for this block if (check_if_exists) { foreach (TimelineViewGhostItem* ghost, parent()->GetGhostItems()) { if (Node::ValueToPtr(ghost->GetData(TimelineViewGhostItem::kAttachedBlock)) == block) { @@ -733,6 +736,7 @@ TimelineViewGhostItem* PointerTool::AddGhostFromBlock(Block* block, Timeline::Mo } } + // Otherwise, it's time to make a ghost for this block TimelineViewGhostItem* ghost = TimelineViewGhostItem::FromBlock(block); #ifdef HIDE_GAP_GHOSTS