timelineview is now a true view of the blocks at all times

This commit is contained in:
itsmattkc
2019-08-11 21:01:37 +10:00
parent 9b63cc7755
commit 149f3fa907
13 changed files with 141 additions and 86 deletions
+13
View File
@@ -20,6 +20,8 @@
#include "block.h"
#include <QDebug>
Block::Block()
{
previous_input_ = new NodeInput();
@@ -37,6 +39,9 @@ Block::Block()
texture_output_ = new NodeOutput();
texture_output_->set_data_type(NodeParam::kTexture);
AddParameter(texture_output_);
connect(this, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SLOT(BlockOrderChanged(NodeEdgePtr)));
connect(this, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SLOT(BlockOrderChanged(NodeEdgePtr)));
}
QString Block::Category()
@@ -115,6 +120,14 @@ void Block::RefreshFollowing()
}
}
void Block::BlockOrderChanged(NodeEdgePtr edge)
{
if (edge->input() == previous_input() || edge->input() == next_input()) {
// The blocks surrounding this one have changed, we need to Refresh()
RefreshFollowing();
}
}
NodeOutput *Block::texture_output()
{
return texture_output_;