diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-03 15:03:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-03 15:03:39 +0400 |
commit | 259e78997a50e4be6ed4f2eda7f128c892ad51ca (patch) | |
tree | b6291b39353e3c785bb3c5ce0a01122651e7fcbb /source/blender/compositor/nodes | |
parent | 1c00740b8155ce2c094189df49ad6ea1ac19b33a (diff) | |
parent | 314a2758505aeba72e2c87f06c5a61c6ceb7773c (diff) |
svn merge ^/trunk/blender -r48489:48527
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r-- | source/blender/compositor/nodes/COM_LensDistortionNode.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp index 0319e66ee22..bb431f86897 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp @@ -48,13 +48,21 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC } else { ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation(); + operation->setData(data); + if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) + { + // no nodes connected to the distortion and dispersion. We can precalculate some values + float distortion = ((const bNodeSocketValueFloat *)this->getInputSocket(1)->getbNodeSocket()->default_value)->value; + float dispersion = ((const bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value; + operation->setDistortionAndDispersion(distortion, dispersion); + } this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); - operation->setData(data); graph->addOperation(operation); } |