| 6556 | } |
| 6557 | |
| 6558 | void |
| 6559 | Node::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 | |
| 6581 | void |
| 6582 | Node::deleteNodeVariableToPython(const std::string& nodeName) |
nothing calls this directly
no test coverage detected