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

Method setNodeVariableToPython

Engine/Node.cpp:6558–6579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6556}
6557
6558void
6559Node::setNodeVariableToPython(const std::string& oldName,
6560 const std::string& newName)
6561{
6562#ifdef NATRON_RUN_WITHOUT_PYTHON
6563
6564 return;
6565#endif
6566 if (getScriptName_mt_safe().empty()) {
6567 return;
6568 }
6569 QString appID = QString::fromUtf8( getApp()->getAppIDString().c_str() );
6570 QString str = QString( appID + QString::fromUtf8(".%1 = ") + appID + QString::fromUtf8(".%2\ndel ") + appID + QString::fromUtf8(".%2\n") ).arg( QString::fromUtf8( newName.c_str() ) ).arg( QString::fromUtf8( oldName.c_str() ) );
6571 std::string script = str.toStdString();
6572 std::string err;
6573 if ( !appPTR->isBackground() ) {
6574 getApp()->printAutoDeclaredVariable(script);
6575 }
6576 if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) {
6577 qDebug() << err.c_str();
6578 }
6579}
6580
6581void
6582Node::deleteNodeVariableToPython(const std::string& nodeName)

Callers

nothing calls this directly

Calls 7

getAppFunction · 0.85
emptyMethod · 0.80
getAppIDStringMethod · 0.80
toStdStringMethod · 0.80
QStringClass · 0.70
isBackgroundMethod · 0.45

Tested by

no test coverage detected