| 6579 | } |
| 6580 | |
| 6581 | void |
| 6582 | Node::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 | |
| 6617 | void |
| 6618 | Node::declarePythonFields() |
nothing calls this directly
no test coverage detected