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

Method runCallbackWithVariables

Engine/OutputSchedulerThread.cpp:1950–1972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1948}
1949
1950void
1951OutputSchedulerThread::runCallbackWithVariables(const QString& callback)
1952{
1953 if ( !callback.isEmpty() ) {
1954 boost::shared_ptr<OutputEffectInstance> effect = _imp->outputEffect.lock();
1955 QString script = callback;
1956 std::string appID = effect->getApp()->getAppIDString();
1957 std::string nodeName = effect->getNode()->getFullyQualifiedName();
1958 std::string nodeFullName = appID + "." + nodeName;
1959 script.append( QString::fromUtf8( nodeFullName.c_str() ) );
1960 script.append( QLatin1Char(',') );
1961 script.append( QString::fromUtf8( appID.c_str() ) );
1962 script.append( QString::fromUtf8(")\n") );
1963
1964 std::string err, output;
1965 if ( !NATRON_PYTHON_NAMESPACE::interpretPythonScript(callback.toStdString(), &err, &output) ) {
1966 effect->getApp()->appendToScriptEditor("Failed to run callback: " + err);
1967 throw std::runtime_error(err);
1968 } else if ( !output.empty() ) {
1969 effect->getApp()->appendToScriptEditor(output);
1970 }
1971 }
1972}
1973
1974////////////////////////////////////////////////////////////
1975////////////////////////////////////////////////////////////

Callers 1

renderFrameMethod · 0.80

Calls 10

getAppIDStringMethod · 0.80
appendMethod · 0.80
toStdStringMethod · 0.80
emptyMethod · 0.80
isEmptyMethod · 0.45
lockMethod · 0.45
getAppMethod · 0.45
getFullyQualifiedNameMethod · 0.45
getNodeMethod · 0.45
appendToScriptEditorMethod · 0.45

Tested by

no test coverage detected