sweeping node graph changes for new rendering pipeline
The new rendering pipeline strives to simplify the nodes themselves as much as possible and move much of the logic to an external rendering engine. This change removes all of the responsibilities that no longer belong to the nodes themselves and will soon be folded into the renderer.
This commit is contained in:
@@ -64,11 +64,11 @@ void Block::set_length(const rational &length)
|
||||
{
|
||||
Q_ASSERT(length > 0);
|
||||
|
||||
Lock();
|
||||
LockUserInput();
|
||||
|
||||
length_ = length;
|
||||
|
||||
Unlock();
|
||||
UnlockUserInput();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ void Block::set_length_and_media_in(const rational &length)
|
||||
|
||||
Block *Block::previous()
|
||||
{
|
||||
return ValueToPtr<Block>(previous_input_->get_value(0));
|
||||
return ValueToPtr<Block>(previous_input_->get_realtime_value_of_connected_output());
|
||||
}
|
||||
|
||||
Block *Block::next()
|
||||
@@ -97,11 +97,8 @@ NodeInput *Block::previous_input()
|
||||
return previous_input_;
|
||||
}
|
||||
|
||||
QVariant Block::Value(NodeOutput *output, const rational &in, const rational &out)
|
||||
QVariant Block::Value(NodeOutput *output)
|
||||
{
|
||||
Q_UNUSED(in)
|
||||
Q_UNUSED(out)
|
||||
|
||||
if (output == block_output_) {
|
||||
// Simply set the output value to a pointer to this Block
|
||||
return PtrToValue(this);
|
||||
@@ -179,7 +176,7 @@ const rational &Block::media_in()
|
||||
|
||||
void Block::set_media_in(const rational &media_in)
|
||||
{
|
||||
Lock();
|
||||
LockUserInput();
|
||||
|
||||
if (media_in_ != media_in) {
|
||||
media_in_ = media_in;
|
||||
@@ -188,7 +185,7 @@ void Block::set_media_in(const rational &media_in)
|
||||
SendInvalidateCache(in(), out());
|
||||
}
|
||||
|
||||
Unlock();
|
||||
UnlockUserInput();
|
||||
}
|
||||
|
||||
const QString &Block::block_name()
|
||||
|
||||
@@ -80,6 +80,8 @@ public:
|
||||
|
||||
virtual bool IsBlock() override;
|
||||
|
||||
virtual QVariant Value(NodeOutput* output) override;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Refreshes internal cache of in/out points up to date
|
||||
@@ -105,8 +107,6 @@ signals:
|
||||
void Refreshed();
|
||||
|
||||
protected:
|
||||
virtual QVariant Value(NodeOutput* output, const rational &in, const rational &out) override;
|
||||
|
||||
rational SequenceToMediaTime(const rational& sequence_time);
|
||||
|
||||
rational MediaToSequenceTime(const rational& media_time);
|
||||
|
||||
@@ -61,21 +61,6 @@ NodeInput *ClipBlock::texture_input()
|
||||
return texture_input_;
|
||||
}
|
||||
|
||||
QVariant ClipBlock::Value(NodeOutput* param, const rational& v_in, const rational &v_out)
|
||||
{
|
||||
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
|
||||
// We convert the time given (timeline time) to media time
|
||||
return texture_input_->get_value(SequenceToMediaTime(v_in), SequenceToMediaTime(v_out));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Block::Value(param, v_in, v_out);
|
||||
}
|
||||
|
||||
void ClipBlock::InvalidateCache(const rational &start_range, const rational &end_range, NodeInput *from)
|
||||
{
|
||||
// If signal is from texture input, transform all times from media time to sequence time
|
||||
@@ -104,3 +89,12 @@ QList<NodeDependency> ClipBlock::RunDependencies(NodeOutput *output, const ratio
|
||||
|
||||
return deps;
|
||||
}
|
||||
|
||||
TimeRange ClipBlock::InputTimeAdjustment(NodeInput *input, const TimeRange &input_time)
|
||||
{
|
||||
if (input == texture_input_) {
|
||||
return TimeRange(SequenceToMediaTime(input_time.in()), SequenceToMediaTime(input_time.out()));
|
||||
}
|
||||
|
||||
return Block::InputTimeAdjustment(input, input_time);
|
||||
}
|
||||
|
||||
@@ -46,8 +46,7 @@ public:
|
||||
|
||||
virtual QList<NodeDependency> RunDependencies(NodeOutput *output, const rational &time) override;
|
||||
|
||||
protected:
|
||||
virtual QVariant Value(NodeOutput* output, const rational &v_in, const rational &v_out) override;
|
||||
virtual TimeRange InputTimeAdjustment(NodeInput* input, const TimeRange& input_time) override;
|
||||
|
||||
private:
|
||||
NodeInput* texture_input_;
|
||||
|
||||
Reference in New Issue
Block a user