MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / declareItemAsPythonField

Method declareItemAsPythonField

Engine/TrackerContext.cpp:1076–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1074}
1075
1076void
1077TrackerContext::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
1104void
1105TrackerContext::declarePythonFields()

Callers

nothing calls this directly

Calls 11

getAppIDStringMethod · 0.80
getNameMethod · 0.80
getNodeFunction · 0.70
getAppMethod · 0.45
getFullyQualifiedNameMethod · 0.45
getScriptName_mt_safeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isBackgroundMethod · 0.45
appendToScriptEditorMethod · 0.45

Tested by

no test coverage detected