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

Method runCallbackWithVariables

Engine/OutputSchedulerThread.cpp:1949–1971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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