| 10850 | } |
| 10851 | |
| 10852 | void |
| 10853 | Node::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 | |
| 10888 | void |
| 10889 | Node::declarePythonFields() |
nothing calls this directly
no test coverage detected