various: fix broken transition creation

It's now possible to create transitions! But they're still broken in
a multitude of other ways so plenty more work to do hahahahahahahahaha
This commit is contained in:
itsmattkc
2020-07-14 22:31:11 +10:00
parent 11afdf32fe
commit ae62750d9d
21 changed files with 415 additions and 33 deletions
@@ -20,6 +20,7 @@
#include "widget/timelinewidget/timelinewidget.h"
#include "node/block/transition/crossdissolve/crossdissolvetransition.h"
#include "node/block/transition/transition.h"
#include "node/factory.h"
#include "widget/nodeview/nodeviewundo.h"
@@ -111,7 +112,14 @@ void TimelineWidget::TransitionTool::MouseRelease(TimelineViewMouseEvent *event)
if (ghost_) {
if (!ghost_->AdjustedLength().isNull()) {
TransitionBlock* transition = static_cast<TransitionBlock*>(NodeFactory::CreateFromID("org.olivevideoeditor.Olive.crossdissolve"));
TransitionBlock* transition;
if (Core::instance()->GetSelectedTransition().isEmpty()) {
// Fallback if the user hasn't selected one yet
transition = new CrossDissolveTransition();
} else {
transition = static_cast<TransitionBlock*>(NodeFactory::CreateFromID(Core::instance()->GetSelectedTransition()));
}
QUndoCommand* command = new QUndoCommand();