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

Method setScriptName

Engine/NodeName.cpp:426–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424} // Node::setNameInternal
425
426void
427Node::setScriptName(const std::string& name)
428{
429 std::string newName;
430
431 if ( getGroup() ) {
432 getGroup()->checkNodeName(this, name, false, true, &newName);
433 } else {
434 newName = name;
435 }
436 if ( NATRON_PYTHON_NAMESPACE::isKeyword(newName) ) {
437 throw std::runtime_error(newName + " is a Python keyword");
438 }
439
440 //We do not allow setting the script-name of output nodes because we rely on it with NatronRenderer
441 if ( dynamic_cast<GroupOutput*>( _imp->effect.get() ) ) {
442 throw std::runtime_error( tr("Changing the script-name of an Output node is not a valid operation.").toStdString() );
443
444 return;
445 }
446
447
448 setNameInternal(newName, true);
449}
450
451NATRON_NAMESPACE_EXIT

Callers

nothing calls this directly

Calls 3

checkNodeNameMethod · 0.80
toStdStringMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected