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

Method declareItemAsPythonField

Engine/TrackerContext.cpp:1057–1083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1055}
1056
1057void
1058TrackerContext::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
1085void
1086TrackerContext::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