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

Method setNodeVariableToPython

Engine/Node.cpp:10829–10850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10827}
10828
10829void
10830Node::setNodeVariableToPython(const std::string& oldName,
10831 const std::string& newName)
10832{
10833#ifdef NATRON_RUN_WITHOUT_PYTHON
10834
10835 return;
10836#endif
10837 if (getScriptName_mt_safe().empty()) {
10838 return;
10839 }
10840 QString appID = QString::fromUtf8( getApp()->getAppIDString().c_str() );
10841 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() ) );
10842 std::string script = str.toStdString();
10843 std::string err;
10844 if ( !appPTR->isBackground() ) {
10845 getApp()->printAutoDeclaredVariable(script);
10846 }
10847 if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0) ) {
10848 qDebug() << err.c_str();
10849 }
10850}
10851
10852void
10853Node::deleteNodeVariableToPython(const std::string& nodeName)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected