don't police data type connections between nodes
Nodes were previously written to be "strongly typed" in that a parameter's "type" enforced whether it could be connected to another. All code related to that has now been removed since not only is it hard to maintain and likely unnecessary, it's possible the nodes will work differently later on anyway.
This commit is contained in:
@@ -26,21 +26,15 @@ Block::Block() :
|
||||
next_(nullptr)
|
||||
{
|
||||
previous_input_ = new NodeInput("prev_block");
|
||||
previous_input_->add_data_input(NodeParam::kBlock);
|
||||
previous_input_->set_data_type(NodeParam::kBlock);
|
||||
previous_input_->set_dependent(false);
|
||||
AddParameter(previous_input_);
|
||||
|
||||
block_output_ = new NodeOutput("block_out");
|
||||
block_output_->set_data_type(NodeParam::kBlock);
|
||||
AddParameter(block_output_);
|
||||
|
||||
texture_output_ = new NodeOutput("tex_out");
|
||||
texture_output_->set_data_type(NodeParam::kTexture);
|
||||
AddParameter(texture_output_);
|
||||
|
||||
samples_output_ = new NodeOutput("samples_out");
|
||||
samples_output_->set_data_type(NodeParam::kSamples);
|
||||
AddParameter(samples_output_);
|
||||
buffer_output_ = new NodeOutput("buffer_out");
|
||||
AddParameter(buffer_output_);
|
||||
|
||||
connect(this, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SLOT(EdgeAddedSlot(NodeEdgePtr)), Qt::DirectConnection);
|
||||
connect(this, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SLOT(EdgeRemovedSlot(NodeEdgePtr)), Qt::DirectConnection);
|
||||
@@ -158,14 +152,9 @@ void Block::Refresh()
|
||||
}
|
||||
}
|
||||
|
||||
NodeOutput *Block::texture_output()
|
||||
NodeOutput *Block::buffer_output()
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
NodeOutput *Block::samples_output()
|
||||
{
|
||||
return samples_output_;
|
||||
return buffer_output_;
|
||||
}
|
||||
|
||||
NodeOutput *Block::block_output()
|
||||
|
||||
@@ -59,8 +59,7 @@ public:
|
||||
|
||||
NodeInput* previous_input();
|
||||
|
||||
NodeOutput* texture_output();
|
||||
NodeOutput* samples_output();
|
||||
NodeOutput* buffer_output();
|
||||
NodeOutput* block_output();
|
||||
|
||||
static void ConnectBlocks(Block* previous, Block* next);
|
||||
@@ -116,8 +115,7 @@ private:
|
||||
NodeInput* previous_input_;
|
||||
NodeOutput* block_output_;
|
||||
|
||||
NodeOutput* texture_output_;
|
||||
NodeOutput* samples_output_;
|
||||
NodeOutput* buffer_output_;
|
||||
|
||||
rational in_point_;
|
||||
rational out_point_;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
ClipBlock::ClipBlock()
|
||||
{
|
||||
texture_input_ = new NodeInput("tex_in");
|
||||
texture_input_->add_data_input(NodeInput::kTexture);
|
||||
texture_input_->set_data_type(NodeInput::kTexture);
|
||||
AddParameter(texture_input_);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ NodeInput *ClipBlock::texture_input()
|
||||
|
||||
QVariant ClipBlock::Value(NodeOutput* param, const rational& v_in, const rational &v_out)
|
||||
{
|
||||
if (param == texture_output()) {
|
||||
if (param == buffer_output()) {
|
||||
// If the time retrieved is within this block, get texture information
|
||||
if (texture_input()->IsConnected() && v_in >= in() && v_out < out()) {
|
||||
// Retrieve texture
|
||||
@@ -98,7 +98,7 @@ QList<NodeDependency> ClipBlock::RunDependencies(NodeOutput *output, const ratio
|
||||
{
|
||||
QList<NodeDependency> deps;
|
||||
|
||||
if (output == texture_output() && texture_input_->IsConnected()) {
|
||||
if (output == buffer_output() && texture_input_->IsConnected()) {
|
||||
deps.append(NodeDependency(texture_input_->get_connected_output(), SequenceToMediaTime(time), SequenceToMediaTime(time)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user