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

Method onScriptNameChanged

Engine/OfxEffectInstance.cpp:3118–3144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3116}
3117
3118void
3119OfxEffectInstance::onScriptNameChanged(const std::string& fullyQualifiedName)
3120{
3121 if (!_imp->effect) {
3122 return;
3123 }
3124 std::size_t foundLastDot = fullyQualifiedName.find_last_of('.');
3125 std::string scriptname, groupprefix, appID;
3126 if (foundLastDot == std::string::npos) {
3127 // No prefix
3128 scriptname = fullyQualifiedName;
3129 } else {
3130 if ( (foundLastDot + 1) < fullyQualifiedName.size() ) {
3131 scriptname = fullyQualifiedName.substr(foundLastDot + 1);
3132 }
3133 groupprefix = fullyQualifiedName.substr(0, foundLastDot);
3134 }
3135 appID = getApp()->getAppIDString();
3136 assert(_imp->effect);
3137 if ( NATRON_PYTHON_NAMESPACE::isKeyword(scriptname) ) {
3138 throw std::runtime_error(scriptname + " is a Python keyword");
3139 }
3140
3141 _imp->effect->getProps().setStringProperty(kNatronOfxImageEffectPropProjectId, appID);
3142 _imp->effect->getProps().setStringProperty(kNatronOfxImageEffectPropGroupId, groupprefix);
3143 _imp->effect->getProps().setStringProperty(kNatronOfxImageEffectPropInstanceId, scriptname);
3144}
3145
3146bool
3147OfxEffectInstance::supportsConcurrentOpenGLRenders() const

Callers

nothing calls this directly

Calls 3

getAppFunction · 0.85
getAppIDStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected