MCPcopy Create free account
hub / github.com/MrKepzie/Natron / exportTrackDataFromExportOptions

Method exportTrackDataFromExportOptions

Engine/TrackerContext.cpp:777–965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777void
778TrackerContext::exportTrackDataFromExportOptions()
779{
780 //bool transformLink = _imp->exportLink.lock()->getValue();
781 boost::shared_ptr<KnobChoice> transformTypeKnob = _imp->transformType.lock();
782
783 assert(transformTypeKnob);
784 int transformType_i = transformTypeKnob->getValue();
785 TrackerTransformNodeEnum transformType = (TrackerTransformNodeEnum)transformType_i;
786 boost::shared_ptr<KnobChoice> motionTypeKnob = _imp->motionType.lock();
787 if (!motionTypeKnob) {
788 return;
789 }
790 int motionType_i = motionTypeKnob->getValue();
791 TrackerMotionTypeEnum mt = (TrackerMotionTypeEnum)motionType_i;
792
793 if (mt == eTrackerMotionTypeNone) {
794 Dialogs::errorDialog( tr("Tracker Export").toStdString(), tr("Please select the export mode with the Motion Type parameter").toStdString() );
795
796 return;
797 }
798
799 bool linked = _imp->exportLink.lock()->getValue();
800 QString pluginID;
801 switch (transformType) {
802 case eTrackerTransformNodeCornerPin:
803 pluginID = QString::fromUtf8(PLUGINID_OFX_CORNERPIN);
804 break;
805 case eTrackerTransformNodeTransform:
806 pluginID = QString::fromUtf8(PLUGINID_OFX_TRANSFORM);
807 break;
808 }
809
810 NodePtr thisNode = getNode();
811 AppInstPtr app = thisNode->getApp();
812 CreateNodeArgs args( pluginID.toStdString(), thisNode->getGroup() );
813 args.setProperty<bool>(kCreateNodeArgsPropAutoConnect, false);
814 args.setProperty<bool>(kCreateNodeArgsPropSettingsOpened, false);
815
816 NodePtr createdNode = app->createNode(args);
817 if (!createdNode) {
818 return;
819 }
820
821 // Move the new node
822 double thisNodePos[2];
823 double thisNodeSize[2];
824 thisNode->getPosition(&thisNodePos[0], &thisNodePos[1]);
825 thisNode->getSize(&thisNodeSize[0], &thisNodeSize[1]);
826 createdNode->setPosition(thisNodePos[0] + thisNodeSize[0] * 2., thisNodePos[1]);
827
828 int timeForFromPoints = getTransformReferenceFrame();
829
830
831 switch (transformType) {
832 case eTrackerTransformNodeCornerPin: {
833 boost::shared_ptr<KnobDouble> cornerPinToPoints[4];
834 boost::shared_ptr<KnobDouble> cornerPinFromPoints[4];

Callers

nothing calls this directly

Calls 15

ViewSpecFunction · 0.85
toStdStringMethod · 0.80
cloneAndUpdateGuiMethod · 0.80
getNodeFunction · 0.70
getCornerPinPointFunction · 0.70
lockMethod · 0.45
getValueMethod · 0.45
getAppMethod · 0.45
getGroupMethod · 0.45
createNodeMethod · 0.45
getPositionMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected