| 1055 | } |
| 1056 | |
| 1057 | void |
| 1058 | TrackerContext::declareItemAsPythonField(const TrackMarkerPtr& item) |
| 1059 | { |
| 1060 | std::string appID = getNode()->getApp()->getAppIDString(); |
| 1061 | std::string nodeName = getNode()->getFullyQualifiedName(); |
| 1062 | std::string nodeFullName = appID + "." + nodeName; |
| 1063 | std::string err; |
| 1064 | std::string itemName = item->getScriptName_mt_safe(); |
| 1065 | std::stringstream ss; |
| 1066 | |
| 1067 | ss << nodeFullName << ".tracker." << itemName << " = "; |
| 1068 | ss << nodeFullName << ".tracker.getTrackByName(\"" << itemName + "\")\n"; |
| 1069 | |
| 1070 | |
| 1071 | const KnobsVec& knobs = item->getKnobs(); |
| 1072 | for (KnobsVec::const_iterator it = knobs.begin(); it != knobs.end(); ++it) { |
| 1073 | ss << nodeFullName << ".tracker." << itemName << "." << (*it)->getName() << " = "; |
| 1074 | ss << nodeFullName << ".tracker." << itemName << ".getParam(\"" << (*it)->getName() << "\")\n"; |
| 1075 | } |
| 1076 | std::string script = ss.str(); |
| 1077 | if ( !appPTR->isBackground() ) { |
| 1078 | getNode()->getApp()->printAutoDeclaredVariable(script); |
| 1079 | } |
| 1080 | if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) { |
| 1081 | getNode()->getApp()->appendToScriptEditor(err); |
| 1082 | } |
| 1083 | } |
| 1084 | |
| 1085 | void |
| 1086 | TrackerContext::declarePythonFields() |
nothing calls this directly
no test coverage detected