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

Method deleteNodeVariableToPython

Engine/Node.cpp:6581–6615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6579}
6580
6581void
6582Node::deleteNodeVariableToPython(const std::string& nodeName)
6583{
6584#ifdef NATRON_RUN_WITHOUT_PYTHON
6585
6586 return;
6587#endif
6588 if (getScriptName_mt_safe().empty()) {
6589 return;
6590 }
6591 if ( getParentMultiInstance() ) {
6592 return;
6593 }
6594
6595 AppInstancePtr app = getApp();
6596 if (!app) {
6597 return;
6598 }
6599 QString appID = QString::fromUtf8( getApp()->getAppIDString().c_str() );
6600 std::string nodeFullName = appID.toStdString() + "." + nodeName;
6601 bool alreadyDefined = false;
6602 PyObject* nodeObj = NATRON_PYTHON_NAMESPACE::getAttrRecursive(nodeFullName, appPTR->getMainModule(), &alreadyDefined);
6603 assert(nodeObj);
6604 Q_UNUSED(nodeObj);
6605 if (alreadyDefined) {
6606 std::string script = "del " + nodeFullName;
6607 std::string err;
6608 if ( !appPTR->isBackground() ) {
6609 getApp()->printAutoDeclaredVariable(script);
6610 }
6611 if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) {
6612 qDebug() << err.c_str();
6613 }
6614 }
6615}
6616
6617void
6618Node::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