nodes: implemented recursive jobs

This commit is contained in:
itsmattkc
2022-05-03 15:03:14 -07:00
parent 4249b82cfc
commit 0e490b94e5
7 changed files with 73 additions and 21 deletions
+17 -3
View File
@@ -30,12 +30,14 @@ namespace olive {
#define super Node
QString ShapeNodeBase::kPositionInput = QStringLiteral("pos_in");
QString ShapeNodeBase::kSizeInput = QStringLiteral("size_in");
QString ShapeNodeBase::kColorInput = QStringLiteral("color_in");
const QString ShapeNodeBase::kBaseInput = QStringLiteral("base_in");
const QString ShapeNodeBase::kPositionInput = QStringLiteral("pos_in");
const QString ShapeNodeBase::kSizeInput = QStringLiteral("size_in");
const QString ShapeNodeBase::kColorInput = QStringLiteral("color_in");
ShapeNodeBase::ShapeNodeBase(bool create_color_input)
{
AddInput(kBaseInput, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
AddInput(kPositionInput, NodeValue::kVec2, QVector2D(0, 0));
AddInput(kSizeInput, NodeValue::kVec2, QVector2D(100, 100));
SetInputProperty(kSizeInput, QStringLiteral("min"), QVector2D(0, 0));
@@ -58,6 +60,9 @@ ShapeNodeBase::ShapeNodeBase(bool create_color_input)
for (int i=0; i<kGizmoScaleCount; i++) {
point_gizmo_[i] = AddDraggableGizmo<PointGizmo>(pos_n_sz, PointGizmo::kAbsolute);
}
SetEffectInput(kBaseInput);
SetFlags(kVideoEffect);
}
void ShapeNodeBase::Retranslate()
@@ -102,6 +107,15 @@ void ShapeNodeBase::UpdateGizmoPositions(const NodeValueRow &row, const NodeGlob
poly_gizmo_->SetPolygon(QRectF(left_pt, top_pt, right_pt - left_pt, bottom_pt - top_pt));
}
ShaderCode ShapeNodeBase::GetShaderCode(const QString &shader_id) const
{
if (shader_id == QStringLiteral("mrg")) {
return ShaderCode(FileFunctions::ReadFileAsString(":/shaders/alphaover.frag"));
}
return ShaderCode();
}
void ShapeNodeBase::GizmoDragMove(double x, double y, const Qt::KeyboardModifiers &modifiers)
{
DraggableGizmo *gizmo = static_cast<DraggableGizmo*>(sender());