| 652 | } |
| 653 | |
| 654 | void |
| 655 | Node::declareRotoPythonField() |
| 656 | { |
| 657 | if (getScriptName_mt_safe().empty()) { |
| 658 | return; |
| 659 | } |
| 660 | assert(_imp->rotoContext); |
| 661 | std::string appID = getApp()->getAppIDString(); |
| 662 | std::string nodeName = getFullyQualifiedName(); |
| 663 | std::string nodeFullName = appID + "." + nodeName; |
| 664 | std::string err; |
| 665 | std::string script = nodeFullName + ".roto = " + nodeFullName + ".getRotoContext()\n"; |
| 666 | if ( !appPTR->isBackground() ) { |
| 667 | getApp()->printAutoDeclaredVariable(script); |
| 668 | } |
| 669 | bool ok = NATRON_PYTHON_NAMESPACE::interpretPythonScript(script, &err, 0); |
| 670 | assert(ok); |
| 671 | if (!ok) { |
| 672 | throw std::runtime_error("Node::declareRotoPythonField(): interpretPythonScript(" + script + ") failed!"); |
| 673 | } |
| 674 | _imp->rotoContext->declarePythonFields(); |
| 675 | } |
| 676 | |
| 677 | void |
| 678 | Node::declareTrackerPythonField() |
nothing calls this directly
no test coverage detected