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

Method deleteNodeVariableToPython

Engine/Node.cpp:10852–10886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10850}
10851
10852void
10853Node::deleteNodeVariableToPython(const std::string& nodeName)
10854{
10855#ifdef NATRON_RUN_WITHOUT_PYTHON
10856
10857 return;
10858#endif
10859 if (getScriptName_mt_safe().empty()) {
10860 return;
10861 }
10862 if ( getParentMultiInstance() ) {
10863 return;
10864 }
10865
10866 AppInstPtr app = getApp();
10867 if (!app) {
10868 return;
10869 }
10870 QString appID = QString::fromUtf8( getApp()->getAppIDString().c_str() );
10871 std::string nodeFullName = appID.toStdString() + "." + nodeName;
10872 bool alreadyDefined = false;
10873 PyObject* nodeObj = NATRON_PYTHON_NAMESPACE::getAttrRecursive(nodeFullName, appPTR->getMainModule(), &alreadyDefined);
10874 assert(nodeObj);
10875 Q_UNUSED(nodeObj);
10876 if (alreadyDefined) {
10877 std::string script = "del " + nodeFullName;
10878 std::string err;
10879 if ( !appPTR->isBackground() ) {
10880 getApp()->printAutoDeclaredVariable(script);
10881 }
10882 if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) {
10883 qDebug() << err.c_str();
10884 }
10885 }
10886}
10887
10888void
10889Node::declarePythonFields()

Callers

nothing calls this directly

Calls 7

getAppFunction · 0.85
emptyMethod · 0.80
getAppIDStringMethod · 0.80
toStdStringMethod · 0.80
getMainModuleMethod · 0.80
isBackgroundMethod · 0.45

Tested by

no test coverage detected