From 850b75fe246308517d7346670709d64f09bd8e9b Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Sat, 7 Aug 2021 15:06:50 +0100 Subject: [PATCH] Transitiosn and gaps are now added. Also removed unnecessary code --- app/core.cpp | 8 -------- app/task/project/loadotio/loadotio.cpp | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/core.cpp b/app/core.cpp index d76896b7d..dc41884a8 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -1501,14 +1501,6 @@ void Core::CacheActiveSequence(bool in_out_only) bool Core::ValidateFootageInLoadedProject(Project* project, const QString& project_saved_url) { QVector project_footage = project->root()->ListChildrenOfType(); - - // OTIO files import their footage into a folder so check them too - foreach(Folder * folder, project->root()->ListChildrenOfType()) { - QVector footage = folder->ListChildrenOfType(); - if (!footage.isEmpty()) { - project_footage.append(footage); - } - } QVector footage_we_couldnt_validate; foreach (Footage* footage, project_footage) { diff --git a/app/task/project/loadotio/loadotio.cpp b/app/task/project/loadotio/loadotio.cpp index f8f26f93b..d327b7a71 100644 --- a/app/task/project/loadotio/loadotio.cpp +++ b/app/task/project/loadotio/loadotio.cpp @@ -206,6 +206,28 @@ bool LoadOTIOTask::Run() transition_block->set_media_in(rational::fromDouble(-otio_block_transition->out_offset().to_seconds())); } prev_block_transition = true; + + // Add nodes to the graph and set up contexts + MultiUndoCommand* command = new MultiUndoCommand(); + + command->add_child(new NodeAddCommand(sequence->parent(), block)); + + // Position transition in its own context + command->add_child(new NodeSetPositionCommand(block, block, QPointF(0, 0), false)); + + Core::instance()->undo_stack()->pushIfHasChildren(command); + } + + if (otio_block->schema_name() == "Gap") { + // Add nodes to the graph and set up contexts + MultiUndoCommand* command = new MultiUndoCommand(); + + command->add_child(new NodeAddCommand(sequence->parent(), block)); + + // Position transition in its own context + command->add_child(new NodeSetPositionCommand(block, block, QPointF(0, 0), false)); + + Core::instance()->undo_stack()->pushIfHasChildren(command); } // Update this after it's used but before any continue statements