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:
authorSergey Sharybin <sergey@blender.org>2020-08-10 17:12:54 +0300
committerSergey Sharybin <sergey@blender.org>2020-08-11 18:00:30 +0300
commiteca062b9cbea5b5e30345ae5de1cf5a089003a19 (patch)
tree8a8d36a9d0ec7f6c9e25d3f1513558532cd51ffc /source/blender/compositor/nodes
parente84e6e12ed39d1661aec236acfcfc899d01c7d0b (diff)
Fix T79563: Compositor's Stabilize 2D in invert mode does not work correctly
Is not only the values of translation/scale/rotation which are to be inverted, but also the order of operations. Differential Revision: https://developer.blender.org/D8518
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r--source/blender/compositor/nodes/COM_Stabilize2dNode.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
index 7a308ac47b9..38db080a154 100644
--- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
+++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
@@ -82,17 +82,32 @@ void Stabilize2dNode::convertToOperations(NodeConverter &converter,
converter.addOperation(rotateOperation);
converter.addOperation(psoperation);
- converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0));
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1));
converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2));
- converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1));
- converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1));
converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2));
- converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0));
converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket());
+
+ if (invert) {
+ // Translate -> Rotate -> Scale.
+ converter.mapInputSocket(imageInput, translateOperation->getInputSocket(0));
+
+ converter.addLink(translateOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
+ converter.addLink(rotateOperation->getOutputSocket(), scaleOperation->getInputSocket(0));
+
+ converter.addLink(scaleOperation->getOutputSocket(), psoperation->getInputSocket(0));
+ }
+ else {
+ // Scale -> Rotate -> Translate.
+ converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0));
+
+ converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0));
+ converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0));
+
+ converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0));
+ }
}