new undo system
Also enables undoing when working with node input arrays
This commit is contained in:
@@ -194,30 +194,28 @@ KeyframePropertiesDialog::KeyframePropertiesDialog(const QVector<NodeKeyframe*>
|
||||
|
||||
void KeyframePropertiesDialog::accept()
|
||||
{
|
||||
QUndoCommand* command = new QUndoCommand();
|
||||
MultiUndoCommand* command = new MultiUndoCommand();
|
||||
|
||||
rational new_time = Timecode::timestamp_to_time(time_slider_->GetValue(), timebase_);
|
||||
int new_type = type_select_->currentData().toInt();
|
||||
|
||||
foreach (NodeKeyframe* key, keys_) {
|
||||
if (time_slider_->isEnabled() && !time_slider_->IsTristate()) {
|
||||
new NodeParamSetKeyframeTimeCommand(key, new_time, command);
|
||||
command->add_child(new NodeParamSetKeyframeTimeCommand(key, new_time));
|
||||
}
|
||||
|
||||
if (new_type > -1) {
|
||||
new KeyframeSetTypeCommand(key, static_cast<NodeKeyframe::Type>(new_type), command);
|
||||
command->add_child(new KeyframeSetTypeCommand(key, static_cast<NodeKeyframe::Type>(new_type)));
|
||||
}
|
||||
|
||||
if (bezier_group_->isEnabled()) {
|
||||
new KeyframeSetBezierControlPoint(key,
|
||||
NodeKeyframe::kInHandle,
|
||||
QPointF(bezier_in_x_slider_->GetValue(), bezier_in_y_slider_->GetValue()),
|
||||
command);
|
||||
command->add_child(new KeyframeSetBezierControlPoint(key,
|
||||
NodeKeyframe::kInHandle,
|
||||
QPointF(bezier_in_x_slider_->GetValue(), bezier_in_y_slider_->GetValue())));
|
||||
|
||||
new KeyframeSetBezierControlPoint(key,
|
||||
NodeKeyframe::kOutHandle,
|
||||
QPointF(bezier_out_x_slider_->GetValue(), bezier_out_y_slider_->GetValue()),
|
||||
command);
|
||||
command->add_child(new KeyframeSetBezierControlPoint(key,
|
||||
NodeKeyframe::kOutHandle,
|
||||
QPointF(bezier_out_x_slider_->GetValue(), bezier_out_y_slider_->GetValue())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user