Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/nodes/COM_Stabilize2dNode.cpp
| Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | void Stabilize2dNode::convertToOperations(NodeConverter &converter, | ||||
| converter.addOperation(angleAttribute); | converter.addOperation(angleAttribute); | ||||
| converter.addOperation(xAttribute); | converter.addOperation(xAttribute); | ||||
| converter.addOperation(yAttribute); | converter.addOperation(yAttribute); | ||||
| converter.addOperation(scaleOperation); | converter.addOperation(scaleOperation); | ||||
| converter.addOperation(translateOperation); | converter.addOperation(translateOperation); | ||||
| converter.addOperation(rotateOperation); | converter.addOperation(rotateOperation); | ||||
| converter.addOperation(psoperation); | converter.addOperation(psoperation); | ||||
| converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); | |||||
| converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); | converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); | ||||
| converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); | converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); | ||||
| converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); | |||||
| converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); | converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); | ||||
| converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); | |||||
| converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); | converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); | ||||
| converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); | converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); | ||||
| converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0)); | |||||
| converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket()); | 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)); | |||||
| } | |||||
| } | } | ||||