Duplicate Layer with layer name + 1? - BUG REPORT

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie » 13 Feb 2018, 09:46

So I have a shortcut assigned for duplicating a layer and structure and renaming the layer and it looks like this in the Configure Keyboard Shortcuts Panel:

LPM_002.PNG
LPM_002.PNG (1.23 KiB) Viewed 2664 times

My Layer Preset Manager is set like this:

LPM_001.PNG
LPM_001.PNG (16.58 KiB) Viewed 2664 times

And it kinda works, it duplicates the structure (with instances empty) and adds a new layer with the same name. But what I would really like, is if it added the new layer with an incremental number. For example my layer is named "Sketch 01", I press my shortcut key and TVP adds a layer named "Sketch 02". I press the shortcut key again, "Sketch 03", etc into oblivion.

(Or for that matter: "Sketch" > shortcut key > "Sketch 01" > shortcut key > "Sketch 02", etc into oblivion)

This should be possible, shouldn't it...? If so, the the big question is... But how?? :shock:
Does anybody have any advice?
Last edited by Sewie on 17 Feb 2018, 10:01, edited 1 time in total.
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

User avatar
Animark
Posts: 500
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Duplicate Layer with layer name + 1?

Post by Animark » 13 Feb 2018, 19:23

I use an action
0 Key:Layer:Duplicate Instances
1 Embedded George Script
2 End

And the george script is:
tv_LayerCurrentID
curID = result
tv_LayerInfo curID
PARSE result layerDisplay layerPosition layerOpacity layerName layerType layerStart layerEnd layerPrelighttable layerPostlighttable layerSelection
newName = layerName"_COL"
tv_LayerRename curID newName

It duplicates a layer, clears the instances and adds "_COL" to the name of the layer. I use it to make new layers for coloring.
MyLayer
MyLayer_COL
MyLayer_COL_COL
...

I think, I've found the script somewhere here in the forum. It don't gives incremental numbers, but adds something to the name. So, maybe it helps a bit to find a way to get incremental numbers.
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)

kariP
Posts: 131
Joined: 20 Jul 2010, 19:14
Location: Turku, Finland

Re: Duplicate Layer with layer name + 1?

Post by kariP » 14 Feb 2018, 12:12

I tried this and I think there's something wrong.

%cln %i should (in my logic) give out
sketch 0
sketch 1
sketch 2
...

But instead it gives
sketch 0
sketch 0 0
sketch 0 0 0
Screen Shot 2018-02-14 at 13.46.53.png
Screen Shot 2018-02-14 at 13.46.53.png (60.04 KiB) Viewed 2609 times

Sewie, is this also what happens with your setup?
iMac OSX El capitan 10.11.6, 32 gb DDR3, Intel Core i7 - tvp pro 11.0.6 - 64 bit Cintiq 22"

User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie » 14 Feb 2018, 13:10

Yes, it is weird.

When I press "Create Layer" in the Layer Preset Manager it adds the zeros, but when I press the shortcut key it just adds a new layer with the same exact name and structure. It didn't do that before I opened it... Also, I can't seem to add a shortcut through the Layer Preset Manager.

What is happening...? :shock: :shock:
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1170
Joined: 28 Dec 2006, 10:08
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Svengali » 16 Feb 2018, 20:10

kariP wrote:
14 Feb 2018, 12:12
%cln %i should (in my logic) give out
I think you must remove the blank between %cln and %i.

What I get is:
existing Layername becomes
Layername_0
subsequent, new Layername becomes
Layername_1
Layername_2
etc.

Sven
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie » 16 Feb 2018, 21:06

It doesn't work for me, Sven.

I get:

Layername (original layer)

subsequent, new Layername becomes
Layername0
Layername00
Layername000

etc.

Also, I can't seem to assign a shortcut key through the layer preset manager.
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1170
Joined: 28 Dec 2006, 10:08
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Svengali » 16 Feb 2018, 21:18

Sewie, you are right, I tested it again trying numerous variations and, indeed, it doesn't work as advertised. Too bad, it promises to be very useful... :(


Wait a minute, try this:

%cln_%i
the underscore parser must be essential... nope, underscore isn't necessary, works with a space: %cln %i

In the end, I think you MUST always go back and re-select the ORIGINAL layer, then the increment seems to work...

Sven
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie » 17 Feb 2018, 09:59

Sven, this does not work for me. I don't know what you've done but if I follow your post I get the strangest results. Perhaps you can add screenshots or something??
Adding an underscore leaves me with.


Layername (original layer)

subsequent, new Layername becomes
Layername_0
Layername_0_0
Layername_0_0_0

I'm going to add that this is a bug in the thread title, perhaps the developers will notice. Because we are running circles here.

Edit;

Wait, I see now what you mean. You have to go back and re-select the original layer before adding a new layer or duplicating, every time. Only then will TVP add an incremental number. I don't see how that is practical in everyday use, so I still think this is a BUG. Either in the software's code or in the team's interpretation of the users workflow.

The problem with not being able to create a shortcut through the Layer Preset Manager remains. (Also a bug I, believe.)
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Svengali
Posts: 1170
Joined: 28 Dec 2006, 10:08
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Svengali » 17 Feb 2018, 10:23

That's it... but I think the complication is in making the duplication routine KNOW that the correct root is used in generating increments.

I never took a close look at the New layer options before. In fact, it took me a while to discover how to edit and delete new-layer-definition rules I'd messed up! Once you understand the rules, it is potentially a very useful function for layer manipulation!

Sven
Desktop: tvp Pro 11.0.8-64bit, Win8.1 - 24GB ram -2TB HHD - 256GB SSD - intuos4 - d.ver.6.3.15-3
Android Tablet: release 11, Samsung Galaxy Note10.1 - 32GB internal - microSD 32GB

User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie » 17 Feb 2018, 10:31

Thanks Sven, I see what you mean.

So if this is what the code does now:

1- takes the original layer name as the root name for the layer to be created.
2- next, the entire list of existing layers is searched to find the HIGHEST existing incremented name.
3- finally, another incremental layer is created using a number ONE HIGHER that the highest existing layer with the same root.


Then the solution would be to replace step 1, and instead take the selected layer as the name for the layer to be created? I'm not a coder but hopefully we are offering the team part of a solution for this particular problem.
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

User avatar
Animark
Posts: 500
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Animark » 17 Feb 2018, 13:13

I know, it's another thing, but it was inspired by this discussion.

It's my first george-script ever and it just covers the base idea of numbering layers. It works fine for my personal use, but it has some limitations. You get an error message, if the last letter of the layers name is not a number. And it will only increase the last number of the name, so after number 19 you'll get 110, 111, ....

Parts of the script are taken from this posting: http://forum.tvpaint.com/viewtopic.php?f=34&t=10294

How to use:
1. The script just gives new layer names. The duplicating of a layer is done by (Key:Layer:Duplicate Instances)
2. The layers name has to have a number as the last letter
doubleLayerPlusNumber.JPG
doubleLayerPlusNumber.JPG (39.15 KiB) Viewed 2474 times
DoubleLayerPlusNumber.tvpx
(5.5 KiB) Downloaded 72 times
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)

User avatar
Animationriver
Posts: 151
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Animationriver » 19 Feb 2018, 14:06

Big Thanks!!! :D
www.youtube.com/c/animationriver
MAC OS 10.11.6 , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.0.8, 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.29-6[/b]

User avatar
Sewie
Posts: 1253
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie » 20 Feb 2018, 10:26

Thanks, Animark.

That will help for now, though I'd much rather see the bugs in the Layer Management Panel fixed without the addition of yet another custom panel. These things have a tendency of multiplying faster than vermin.
Michael Sewnarain - SewieBlog
Windows 10/64b - TVP11.0.8 - Pro/64b - Cintiq24HD

Post Reply