Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
index 040a0315d69..5ddf15f7684 100644
--- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
+++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.cpp
@@ -31,12 +31,14 @@ MovieClipAttributeOperation::MovieClipAttributeOperation() : NodeOperation()
this->m_valueSet = false;
this->m_framenumber = 0;
this->m_attribute = MCA_X;
+ this->m_invert = false;
}
void MovieClipAttributeOperation::executePixelSampled(float output[4],
float /*x*/, float /*y*/,
PixelSampler /*sampler*/)
{
+ /* TODO(sergey): This code isn't really thread-safe. */
if (!this->m_valueSet) {
float loc[2], scale, angle;
loc[0] = 0.0f;
@@ -61,6 +63,14 @@ void MovieClipAttributeOperation::executePixelSampled(float output[4],
this->m_value = loc[1];
break;
}
+ if (this->m_invert) {
+ if (this->m_attribute != MCA_SCALE) {
+ this->m_value = -this->m_value;
+ }
+ else {
+ this->m_value = 1.0f / this->m_value;
+ }
+ }
this->m_valueSet = true;
}
output[0] = this->m_value;