node importing down

This commit is contained in:
itsmattkc
2019-08-11 21:13:16 +10:00
parent 149f3fa907
commit dc4a460e32
4 changed files with 41 additions and 7 deletions
+8
View File
@@ -22,6 +22,8 @@
#include <QMimeData>
#include "node/input/media/media.h"
TimelineView::ImportTool::ImportTool(TimelineView *parent) :
Tool(parent)
{
@@ -103,9 +105,15 @@ void TimelineView::ImportTool::DragDrop(QDropEvent *event)
if (parent()->HasGhosts()) {
foreach (TimelineViewGhostItem* ghost, parent()->ghost_items_) {
ClipBlock* clip = new ClipBlock();
MediaInput* media = new MediaInput();
clip->set_length(ghost->Out() - ghost->In());
media->SetFootage(ghost->stream()->footage());
NodeParam::ConnectEdge(media->texture_output(), clip->texture_input());
// FIXME: If this doesn't have a TimelineOutput node attached, this is a memory leak. Maybe switching nodes to
// shared ptrs would be a better idea.
emit parent()->RequestInsertBlock(clip, 0);
}