| 1074 | } |
| 1075 | |
| 1076 | void |
| 1077 | TrackerContext::declareItemAsPythonField(const TrackMarkerPtr& item) |
| 1078 | { |
| 1079 | std::string appID = getNode()->getApp()->getAppIDString(); |
| 1080 | std::string nodeName = getNode()->getFullyQualifiedName(); |
| 1081 | std::string nodeFullName = appID + "." + nodeName; |
| 1082 | std::string err; |
| 1083 | std::string itemName = item->getScriptName_mt_safe(); |
| 1084 | std::stringstream ss; |
| 1085 | |
| 1086 | ss << nodeFullName << ".tracker." << itemName << " = "; |
| 1087 | ss << nodeFullName << ".tracker.getTrackByName(\"" << itemName + "\")\n"; |
| 1088 | |
| 1089 | |
| 1090 | const KnobsVec& knobs = item->getKnobs(); |
| 1091 | for (KnobsVec::const_iterator it = knobs.begin(); it != knobs.end(); ++it) { |
| 1092 | ss << nodeFullName << ".tracker." << itemName << "." << (*it)->getName() << " = "; |
| 1093 | ss << nodeFullName << ".tracker." << itemName << ".getParam(\"" << (*it)->getName() << "\")\n"; |
| 1094 | } |
| 1095 | std::string script = ss.str(); |
| 1096 | if ( !appPTR->isBackground() ) { |
| 1097 | getNode()->getApp()->printAutoDeclaredVariable(script); |
| 1098 | } |
| 1099 | if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) { |
| 1100 | getNode()->getApp()->appendToScriptEditor(err); |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | void |
| 1105 | TrackerContext::declarePythonFields() |
nothing calls this directly
no test coverage detected