multicam: allow overrides by selecting multicam nodes in nodeview
This commit is contained in:
@@ -77,6 +77,11 @@ public:
|
||||
GetViewerWidget()->SetTimelineSelectedBlocks(b);
|
||||
}
|
||||
|
||||
void SetNodeViewSelections(const QVector<Node*> &n)
|
||||
{
|
||||
GetViewerWidget()->SetNodeViewSelections(n);
|
||||
}
|
||||
|
||||
void ConnectMulticamWidget(MulticamWidget *p)
|
||||
{
|
||||
GetViewerWidget()->ConnectMulticamWidget(p);
|
||||
|
||||
@@ -260,6 +260,9 @@ void ViewerWidget::DisconnectNodeEvent(ViewerOutput *n)
|
||||
disconnect(n->video_frame_cache(), &FrameHashCache::Invalidated, this, &ViewerWidget::ViewerInvalidatedVideoRange);
|
||||
disconnect(n, &ViewerOutput::TextureInputChanged, this, &ViewerWidget::UpdateWaveformViewFromMode);
|
||||
|
||||
timeline_selected_blocks_.clear();
|
||||
node_view_selected_.clear();
|
||||
|
||||
CloseAudioProcessor();
|
||||
audio_scrub_watchers_.clear();
|
||||
|
||||
@@ -621,12 +624,30 @@ void ViewerWidget::DetectMulticamNode(const rational &time)
|
||||
// Faster way to do this
|
||||
if (multicam_panel_ && multicam_panel_->isVisible()) {
|
||||
if (Sequence *s = dynamic_cast<Sequence*>(GetConnectedNode())) {
|
||||
// Prefer selected blocks
|
||||
for (Block *b : timeline_selected_blocks_) {
|
||||
if (b->range().Contains(time)) {
|
||||
if ((clip = dynamic_cast<ClipBlock*>(b))) {
|
||||
if ((multicam = clip->FindMulticam())) {
|
||||
break;
|
||||
// Prefer selected nodes
|
||||
for (Node *n : qAsConst(node_view_selected_)) {
|
||||
if ((multicam = dynamic_cast<MultiCamNode*>(n))) {
|
||||
// Found multicam, now try to find corresponding clip from selected timeline blocks
|
||||
for (Block *b : qAsConst(timeline_selected_blocks_)) {
|
||||
if (ClipBlock *c = dynamic_cast<ClipBlock*>(b)) {
|
||||
if (c->range().Contains(time) && c->ContextContainsNode(multicam)) {
|
||||
clip = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Next, prefer multicam from selected block
|
||||
if (!multicam) {
|
||||
for (Block *b : qAsConst(timeline_selected_blocks_)) {
|
||||
if (b->range().Contains(time)) {
|
||||
if ((clip = dynamic_cast<ClipBlock*>(b))) {
|
||||
if ((multicam = clip->FindMulticam())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +122,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetNodeViewSelections(const QVector<Node*> &n)
|
||||
{
|
||||
node_view_selected_ = n;
|
||||
|
||||
if (!IsPlaying()) {
|
||||
// If is playing, this will happen by the next frame automatically
|
||||
DetectMulticamNode(GetTime());
|
||||
UpdateTextureFromNode();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectMulticamWidget(MulticamWidget *p);
|
||||
|
||||
public slots:
|
||||
@@ -340,6 +351,7 @@ private:
|
||||
int ignore_scrub_;
|
||||
|
||||
QVector<Block*> timeline_selected_blocks_;
|
||||
QVector<Node*> node_view_selected_;
|
||||
|
||||
MulticamWidget *multicam_panel_;
|
||||
|
||||
|
||||
@@ -105,6 +105,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(param_panel_, &ParamPanel::FocusedNodeChanged, curve_panel_, &CurvePanel::SetNode);
|
||||
connect(param_panel_, &ParamPanel::SelectedNodesChanged, node_panel_, &NodePanel::Select);
|
||||
|
||||
connect(node_panel_, &NodePanel::NodeSelectionChanged, sequence_viewer_panel_, &ViewerPanel::SetNodeViewSelections);
|
||||
|
||||
// Connect time signals together
|
||||
AddMainTimePanel(multicam_panel_);
|
||||
AddMainTimePanel(curve_panel_);
|
||||
|
||||
Reference in New Issue
Block a user