nodeparamviewwidgetbridge: null check time target

This commit is contained in:
itsmattkc
2022-11-07 22:01:52 -08:00
parent 373717629e
commit 2aaa2fb87c
3 changed files with 3 additions and 14 deletions
+1 -9
View File
@@ -40,7 +40,6 @@ NodeParamView::NodeParamView(bool create_keyframe_view, QWidget *parent) :
super(true, false, parent),
last_scroll_val_(0),
focused_node_(nullptr),
time_target_(nullptr),
show_all_nodes_(false)
{
// Create horizontal layout to place scroll area in (and keyframe editing eventually)
@@ -365,13 +364,6 @@ void NodeParamView::ConnectedNodeChangeEvent(ViewerOutput *n)
foreach (NodeParamViewContext* item, context_items_) {
item->SetTimeTarget(n);
}
time_target_ = n;
}
ViewerOutput *NodeParamView::GetTimeTarget() const
{
return time_target_;
}
void ReconnectOutputsIfNotDeletingNode(MultiUndoCommand *c, NodeViewDeleteCommand *dc, Node *output, Node *deleting, Node *context)
@@ -721,7 +713,7 @@ void NodeParamView::AddNode(Node *n, Node *ctx, NodeParamViewContext *context)
connect(item, &NodeParamViewItem::RequestEditTextInViewer, this, &NodeParamView::RequestEditTextInViewer);
item->SetContext(ctx);
item->SetTimeTarget(GetTimeTarget());
item->SetTimeTarget(GetConnectedNode());
item->SetTimebase(timebase());
context->AddNode(item);
-4
View File
@@ -48,8 +48,6 @@ public:
void CloseContextsBelongingToProject(Project *p);
ViewerOutput *GetTimeTarget() const;
void DeleteSelected();
void SelectAll()
@@ -156,8 +154,6 @@ private:
NodeParamViewItem* focused_node_;
QVector<NodeParamViewItem*> selected_nodes_;
ViewerOutput *time_target_;
QVector<Node*> contexts_;
QVector<Node*> current_contexts_;
@@ -547,7 +547,8 @@ void NodeParamViewWidgetBridge::TimeTargetConnectEvent(ViewerOutput *v)
void NodeParamViewWidgetBridge::InputValueChanged(const NodeInput &input, const TimeRange &range)
{
if (GetInnerInput() == input
if (GetTimeTarget()
&& GetInnerInput() == input
&& !dragger_.IsStarted()
&& range.in() <= GetTimeTarget()->GetPlayhead() && range.out() >= GetTimeTarget()->GetPlayhead()) {
// We'll need to update the widgets because the values have changed on our current time