nodeparamviewwidgetbridge: null check time target
This commit is contained in:
@@ -40,7 +40,6 @@ NodeParamView::NodeParamView(bool create_keyframe_view, QWidget *parent) :
|
|||||||
super(true, false, parent),
|
super(true, false, parent),
|
||||||
last_scroll_val_(0),
|
last_scroll_val_(0),
|
||||||
focused_node_(nullptr),
|
focused_node_(nullptr),
|
||||||
time_target_(nullptr),
|
|
||||||
show_all_nodes_(false)
|
show_all_nodes_(false)
|
||||||
{
|
{
|
||||||
// Create horizontal layout to place scroll area in (and keyframe editing eventually)
|
// 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_) {
|
foreach (NodeParamViewContext* item, context_items_) {
|
||||||
item->SetTimeTarget(n);
|
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)
|
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);
|
connect(item, &NodeParamViewItem::RequestEditTextInViewer, this, &NodeParamView::RequestEditTextInViewer);
|
||||||
|
|
||||||
item->SetContext(ctx);
|
item->SetContext(ctx);
|
||||||
item->SetTimeTarget(GetTimeTarget());
|
item->SetTimeTarget(GetConnectedNode());
|
||||||
item->SetTimebase(timebase());
|
item->SetTimebase(timebase());
|
||||||
|
|
||||||
context->AddNode(item);
|
context->AddNode(item);
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ public:
|
|||||||
|
|
||||||
void CloseContextsBelongingToProject(Project *p);
|
void CloseContextsBelongingToProject(Project *p);
|
||||||
|
|
||||||
ViewerOutput *GetTimeTarget() const;
|
|
||||||
|
|
||||||
void DeleteSelected();
|
void DeleteSelected();
|
||||||
|
|
||||||
void SelectAll()
|
void SelectAll()
|
||||||
@@ -156,8 +154,6 @@ private:
|
|||||||
NodeParamViewItem* focused_node_;
|
NodeParamViewItem* focused_node_;
|
||||||
QVector<NodeParamViewItem*> selected_nodes_;
|
QVector<NodeParamViewItem*> selected_nodes_;
|
||||||
|
|
||||||
ViewerOutput *time_target_;
|
|
||||||
|
|
||||||
QVector<Node*> contexts_;
|
QVector<Node*> contexts_;
|
||||||
QVector<Node*> current_contexts_;
|
QVector<Node*> current_contexts_;
|
||||||
|
|
||||||
|
|||||||
@@ -547,7 +547,8 @@ void NodeParamViewWidgetBridge::TimeTargetConnectEvent(ViewerOutput *v)
|
|||||||
|
|
||||||
void NodeParamViewWidgetBridge::InputValueChanged(const NodeInput &input, const TimeRange &range)
|
void NodeParamViewWidgetBridge::InputValueChanged(const NodeInput &input, const TimeRange &range)
|
||||||
{
|
{
|
||||||
if (GetInnerInput() == input
|
if (GetTimeTarget()
|
||||||
|
&& GetInnerInput() == input
|
||||||
&& !dragger_.IsStarted()
|
&& !dragger_.IsStarted()
|
||||||
&& range.in() <= GetTimeTarget()->GetPlayhead() && range.out() >= GetTimeTarget()->GetPlayhead()) {
|
&& range.in() <= GetTimeTarget()->GetPlayhead() && range.out() >= GetTimeTarget()->GetPlayhead()) {
|
||||||
// We'll need to update the widgets because the values have changed on our current time
|
// We'll need to update the widgets because the values have changed on our current time
|
||||||
|
|||||||
Reference in New Issue
Block a user