| 794 | } |
| 795 | |
| 796 | void |
| 797 | TrackerContext::exportTrackDataFromExportOptions() |
| 798 | { |
| 799 | //bool transformLink = _imp->exportLink.lock()->getValue(); |
| 800 | KnobChoicePtr transformTypeKnob = _imp->transformType.lock(); |
| 801 | |
| 802 | assert(transformTypeKnob); |
| 803 | int transformType_i = transformTypeKnob->getValue(); |
| 804 | TrackerTransformNodeEnum transformType = (TrackerTransformNodeEnum)transformType_i; |
| 805 | KnobChoicePtr motionTypeKnob = _imp->motionType.lock(); |
| 806 | if (!motionTypeKnob) { |
| 807 | return; |
| 808 | } |
| 809 | int motionType_i = motionTypeKnob->getValue(); |
| 810 | TrackerMotionTypeEnum mt = (TrackerMotionTypeEnum)motionType_i; |
| 811 | |
| 812 | if (mt == eTrackerMotionTypeNone) { |
| 813 | Dialogs::errorDialog( tr("Tracker Export").toStdString(), tr("Please select the export mode with the Motion Type parameter").toStdString() ); |
| 814 | |
| 815 | return; |
| 816 | } |
| 817 | |
| 818 | bool linked = _imp->exportLink.lock()->getValue(); |
| 819 | QString pluginID; |
| 820 | switch (transformType) { |
| 821 | case eTrackerTransformNodeCornerPin: |
| 822 | pluginID = QString::fromUtf8(PLUGINID_OFX_CORNERPIN); |
| 823 | break; |
| 824 | case eTrackerTransformNodeTransform: |
| 825 | pluginID = QString::fromUtf8(PLUGINID_OFX_TRANSFORM); |
| 826 | break; |
| 827 | } |
| 828 | |
| 829 | NodePtr thisNode = getNode(); |
| 830 | AppInstancePtr app = thisNode->getApp(); |
| 831 | CreateNodeArgs args( pluginID.toStdString(), thisNode->getGroup() ); |
| 832 | args.setProperty<bool>(kCreateNodeArgsPropAutoConnect, false); |
| 833 | args.setProperty<bool>(kCreateNodeArgsPropSettingsOpened, false); |
| 834 | |
| 835 | NodePtr createdNode = app->createNode(args); |
| 836 | if (!createdNode) { |
| 837 | return; |
| 838 | } |
| 839 | |
| 840 | // Move the new node |
| 841 | double thisNodePos[2]; |
| 842 | double thisNodeSize[2]; |
| 843 | thisNode->getPosition(&thisNodePos[0], &thisNodePos[1]); |
| 844 | thisNode->getSize(&thisNodeSize[0], &thisNodeSize[1]); |
| 845 | createdNode->setPosition(thisNodePos[0] + thisNodeSize[0] * 2., thisNodePos[1]); |
| 846 | |
| 847 | int timeForFromPoints = getTransformReferenceFrame(); |
| 848 | |
| 849 | |
| 850 | switch (transformType) { |
| 851 | case eTrackerTransformNodeCornerPin: { |
| 852 | KnobDoublePtr cornerPinToPoints[4]; |
| 853 | KnobDoublePtr cornerPinFromPoints[4]; |
nothing calls this directly
no test coverage detected