Merge branch 'move-time-to-viewer'
This commit is contained in:
@@ -57,13 +57,6 @@ NodeParamViewWidgetBridge::NodeParamViewWidgetBridge(NodeInput input, QObject *p
|
||||
CreateWidgets();
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::SetTime(const rational &time)
|
||||
{
|
||||
time_ = time;
|
||||
|
||||
UpdateWidgetValues();
|
||||
}
|
||||
|
||||
int GetSliderCount(NodeValue::Type type)
|
||||
{
|
||||
return NodeValue::get_number_of_keyframe_tracks(type);
|
||||
@@ -528,7 +521,11 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues()
|
||||
|
||||
rational NodeParamViewWidgetBridge::GetCurrentTimeAsNodeTime() const
|
||||
{
|
||||
return GetAdjustedTime(GetTimeTarget(), GetInnerInput().node(), time_, Node::kTransformTowardsInput);
|
||||
if (GetTimeTarget()) {
|
||||
return GetAdjustedTime(GetTimeTarget(), GetInnerInput().node(), GetTimeTarget()->GetPlayhead(), Node::kTransformTowardsInput);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::SetTimebase(const rational& timebase)
|
||||
@@ -538,11 +535,21 @@ void NodeParamViewWidgetBridge::SetTimebase(const rational& timebase)
|
||||
}
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::TimeTargetDisconnectEvent(ViewerOutput *v)
|
||||
{
|
||||
disconnect(v, &ViewerOutput::PlayheadChanged, this, &NodeParamViewWidgetBridge::UpdateWidgetValues);
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::TimeTargetConnectEvent(ViewerOutput *v)
|
||||
{
|
||||
connect(v, &ViewerOutput::PlayheadChanged, this, &NodeParamViewWidgetBridge::UpdateWidgetValues);
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::InputValueChanged(const NodeInput &input, const TimeRange &range)
|
||||
{
|
||||
if (GetInnerInput() == input
|
||||
&& !dragger_.IsStarted()
|
||||
&& range.in() <= time_ && range.out() >= time_) {
|
||||
&& range.in() <= GetTimeTarget()->GetPlayhead() && range.out() >= GetTimeTarget()->GetPlayhead()) {
|
||||
// We'll need to update the widgets because the values have changed on our current time
|
||||
UpdateWidgetValues();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user