Permalink
Browse files

engine: add translation/scaling attributes to the Video function

Let the UI video provider handle attributes
  • Loading branch information...
mcallegari committed Nov 25, 2018
1 parent 24cad48 commit c7f628b47b370fc5c48df9fb9bbf348c9d942850
Showing with 9 additions and 21 deletions.
  1. +5 −21 engine/src/video.cpp
  2. +4 −0 engine/src/video.h
@@ -61,7 +61,10 @@ Video::Video(Doc* doc)
registerAttribute(tr("X Rotation"), Function::LastWins, -360.0, 360.0, 0.0);
registerAttribute(tr("Y Rotation"), Function::LastWins, -360.0, 360.0, 0.0);
registerAttribute(tr("Z Rotation"), Function::LastWins, -360.0, 360.0, 0.0);
registerAttribute(tr("X Position"), Function::LastWins, -100.0, 100.0, 0.0);
registerAttribute(tr("Y Position"), Function::LastWins, -100.0, 100.0, 0.0);
registerAttribute(tr("Width scale"), Function::LastWins, 0, 1000.0, 100.0);
registerAttribute(tr("Height scale"), Function::LastWins, 0, 1000.0, 100.0);
// Listen to member Function removals
connect(doc, SIGNAL(functionRemoved(quint32)),
@@ -326,26 +329,7 @@ int Video::adjustAttribute(qreal fraction, int attributeId)
emit intensityChanged();
}
break;
case XRotation:
{
QVector3D rot = rotation();
rot.setX(getAttributeValue(XRotation));
setRotation(rot);
}
break;
case YRotation:
{
QVector3D rot = rotation();
rot.setY(getAttributeValue(YRotation));
setRotation(rot);
}
break;
case ZRotation:
{
QVector3D rot = rotation();
rot.setZ(getAttributeValue(ZRotation));
setRotation(rot);
}
default:
break;
}
@@ -55,6 +55,10 @@ class Video : public Function
XRotation,
YRotation,
ZRotation,
XPosition,
YPosition,
WidthScale,
HeightScale
};
Video(Doc* doc);

0 comments on commit c7f628b

Please sign in to comment.