Welcome to WSL!

New to the forum? Please read this and this.

Copy-Paste / Duplicate with smarter numbering

Moderator: Chad

User avatar
jedmitchell
Fusioneer
Posts: 54
Joined: Mon Feb 27, 2017 5:11 pm

Copy-Paste / Duplicate with smarter numbering

#1

Post by jedmitchell »

I would like the "duplicate" / copy-paste commands to exhibit some intelligence when renaming the nodes they create. Specifically, if the node ends in a number, have that number advance to 1 + the current highest numbered node with the same name.

So, Merge4 --> Merge5 instead of Merge4 --> Merge4_1.

This one has killed me forever, but on my current job it's just a constant face palm seeing stuff like this:
Image

It's... fine (I guess) to rename nodes yourself when there are a limited number of them, but not when you've got processes that need to happen dozens of times in different parts of a comp on different image sequences.

BMD should just have a better duplicate command, but is this something that could be scripted (and remapped to copy / paste)? I don't even mind having to do it myself (it feels like it should be relatively doable, even for a low-grade programmer like myself), but the fact that such a script doesn't already exist makes me think there must be some "gotcha."

As a consolation prize I would accept a script that parses the whole node tree and renames everything in one fell swoop. Just... no more "Merge6_1_1_2_1_1_2_1_1..."

User avatar
SirEdric
Fusionator
Posts: 2384
Joined: Tue Aug 05, 2014 10:04 am
Answers: 12
Real name: Eric Westphal
Been thanked: 4 times
Contact:

Re: Copy-Paste / Duplicate with smarter numbering

#2

Post by SirEdric »

You could try Prefs->Global->General-> 'Use simplified Copy Names'. That should help...:-)

User avatar
jedmitchell
Fusioneer
Posts: 54
Joined: Mon Feb 27, 2017 5:11 pm

Re: Copy-Paste / Duplicate with smarter numbering

#3

Post by jedmitchell »

SirEdric wrote: Mon Jan 13, 2020 8:42 amYou could try Prefs->Global->General-> 'Use simplified Copy Names'. That should help...:-)
Oh wat. I guess I just didn't know what to search for in the manual, I feel like I've searched for and given up on this once very ~6 months since Fu7.

That option doesn't quite explain itself. That kind of does the job -- it still appends an additional _# beyond the original numeric value, but I guess it's a step in the right direction. Thanks!

Next time I'm between jobs I might try scripting a simple "cleanup" renaming script to run on command, I can imagine this would still get a little messy with enough nodes.

User avatar
Midgardsormr
Fusionator
Posts: 2143
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 28
Location: Los Angeles, CA, USA
Been thanked: 36 times
Contact:

Re: Copy-Paste / Duplicate with smarter numbering

#4

Post by Midgardsormr »

That's not a bad idea. Would make tidying up macros easier. They tend to accumulate those _#'s during development.

User avatar
Tory
Fusioneer
Posts: 92
Joined: Fri Apr 13, 2018 11:29 am
Real name: Tory Hooton
Contact:

Re: Copy-Paste / Duplicate with smarter numbering

#5

Post by Tory »

This is the behavior that I discovered while testing.

With out 'Use Simplified Copy Names'
* first copy paste always adds additional _#
* additional paste for copy increments # (as in copy - paste - paste)

With 'Use Simplified Copy Names'
* first copy paste will increment # IF it is after a _ (you could get wanted behavior by naming Tool_1)
* first copy paste will add _# even if the name is tool3

I can see the logic of both behaviors... for me I think it is much more useful to have this setting on though so thanks @SirEdric :)

User avatar
SirEdric
Fusionator
Posts: 2384
Joined: Tue Aug 05, 2014 10:04 am
Answers: 12
Real name: Eric Westphal
Been thanked: 4 times
Contact:

Re: Copy-Paste / Duplicate with smarter numbering

#6

Post by SirEdric »

You're welcome, @Tory ...:-)

User avatar
jedmitchell
Fusioneer
Posts: 54
Joined: Mon Feb 27, 2017 5:11 pm

Re: Copy-Paste / Duplicate with smarter numbering

#7

Post by jedmitchell »

Yes, it's... almost what I'd expect, and frankly good enough to keep the names short enough to fit in a node. Thanks again @SirEdric, I am duly chastened for my poor manual reading skills.

User avatar
SirEdric
Fusionator
Posts: 2384
Joined: Tue Aug 05, 2014 10:04 am
Answers: 12
Real name: Eric Westphal
Been thanked: 4 times
Contact:

Re: Copy-Paste / Duplicate with smarter numbering

#8

Post by SirEdric »

jedmitchell wrote: Tue Jan 14, 2020 11:53 am poor manual reading skills.
Thy manual thou shalthed readeth intenselieth.