| 424 | } // Node::setNameInternal |
| 425 | |
| 426 | void |
| 427 | Node::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 | |
| 451 | NATRON_NAMESPACE_EXIT |
nothing calls this directly
no test coverage detected