Page 1 of 1

how to duplicate a layer?

Posted: Sat Jul 25, 2009 2:20 pm
by Vincent-Pimousse
Hello,

I can't find the way to duplicate a layer to another position.
I tried something like:
layer_source = 1
destination = 2
modul8.setValue('ctrl_layerStack_duplicate', destination, layer_source)

Any idea?

Posted: Sat Jul 25, 2009 8:13 pm
by mowgli_uk
there's a switch that does that

Posted: Sat Jul 25, 2009 10:28 pm
by Vincent-Pimousse
mowgli_uk wrote:there's a switch that does that

Sure, but how to control this switch by scripting? Undestand it is not the only aim of my module but I am blocked at this point.
I think I use the good way with my short example but I can't find the mistake.

Posted: Thu Aug 13, 2009 3:48 pm
by sigmasix
Salut Vincent,

Bon, je me suis un peu pris la tête à chercher aussi… Le dico des keyword manque un peu de précisions…

Bon, c'est bien le bon keyword que tu utilisais, par contre la valeur à passer est une list, pas le stack de destination… et le numéro de calque doit être 10 et pas autre chose…

En gros pour dupliquer le calque 1 dans le stack 2 :

modul8.setValue('ctrl_layerStack_duplicate', [1, 2], 10)


Si tu veux dupliquer le layer sélectionné, tu peux procéder comme ca:

selected = modul8.getValue('ctrl_layerStack_focusPosition', 0)
destination = 6
modul8.setValue('ctrl_layerStack_duplicate', [selected, destination], 10)


J'espère que ca peut t'aider!

Sinon, le module PrintDirectEvent peut vraiment t'aider dans ce genre de situation, tu peux cocher keyword et il va te printer le keyword et ses valeurs lorsque tu clique sur un bouton dans l'interface.

Posted: Thu Aug 13, 2009 4:40 pm
by Lupin
and to see this Keyword in action your can download the fresh new module
(vs) Duplicate LayerStack
which duplicates layers from A stack to B and vice versa
have fun

Posted: Sat Aug 15, 2009 1:24 pm
by The Midi Thief
That's f***i'n handy, Lupin! Another great module! Thanks!