Skip to content

Allow node name reuse after delete - #733

Merged
devernay merged 2 commits into
RB-2.4from
allow-node-name-reuse
Dec 24, 2021
Merged

devernay merged 2 commits into
RB-2.4from
allow-node-name-reuse

Conversation

@devernay

Copy link
Copy Markdown
Member

This PR is against RB-2.4, but will be merged in RB-2.5 ultimately.

fixes #732 (this bug has been here forever)

Explanation: the nodes are not deleted while they're still in the Undo stack (which has a depth of 20 actions by default). You'll notice that if you do 20 actions (move 20 times a node in the graph), you will be able to do that rename.

I have a proposed change, which allows using the name of an existing deactivated node. To reactivate the deactivated node, the name change would be reverted by RenameNodeUndoRedoCommand::undo() anyway.

I had to add a few checks in the code:
I had to make sure that every use of Node::getScriptName_mt_safe() (except for printing messages) was also checking if the node was activated.

This seems to work.

@rodlie @YakoYakoYokuYoku Please decline the review if you think you can't review

@rodlie rodlie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works for me. I have not noticed any undo issues related to this change.

@YakoYakoYokuYoku YakoYakoYokuYoku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test for RB-2.5 too.

@devernay
devernay merged commit ec9b55a into RB-2.4 Dec 24, 2021
devernay added a commit that referenced this pull request Dec 25, 2021
* Allow node name reuse after delete

fixes #732

* when creating/pasting nodes, don't add more underscores than necessary.

addresses #732 (comment)
Niik-l pushed a commit to Niik-l/Natron that referenced this pull request Apr 8, 2026
* Allow node name reuse after delete

fixes NatronGitHub#732

* when creating/pasting nodes, don't add more underscores than necessary.

addresses NatronGitHub#732 (comment)
Niik-l pushed a commit to Niik-l/Natron that referenced this pull request Apr 8, 2026
* Allow node name reuse after delete

fixes NatronGitHub#732

* when creating/pasting nodes, don't add more underscores than necessary.

addresses NatronGitHub#732 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants