Hi, I was hoping there may be a way to create a tool that automatically selects a specific layer. For example if I have a black pen size 1.60 in a custom panel, is it possible that whenever I select that tool it could automatically take me to a specific layer, for example named "sketch"?
Something like Layer: Select "Sketch" Layer, if you know what I mean?
How to create a tool that selects a specific layer?
Re: How to create a tool that selects a specific layer?
Hello Farrow,
Yes it is possible
Here is a custom panel that does it. It contains a custom panel, with a black Pen Brush, with size 1.60, and it select a layer named "Sketch". If no layer named "Sketch" is found, then it display a warning. And the George code :
Yes it is possible
Here is a custom panel that does it. It contains a custom panel, with a black Pen Brush, with size 1.60, and it select a layer named "Sketch". If no layer named "Sketch" is found, then it display a warning. And the George code :
Code: Select all
loop=1
i=0
found=0
tv_layerCurrentID
current=RESULT
WHILE (loop)
tv_LayerGetID i
curLID = result
IF (CMP(curLID,"none")==0)
tv_layerSet curLID
tv_LayerInfo
PARSE result layerDisplay layerPosition layerOpacity layerName layerType layerStart layerEnd layerPrelighttable layerPostlighttable layerSelection
IF (CMP(layerName,"sketch")==1)
found=1
loop=0
END
ELSE
loop=0
END
i=i+1
END
IF (found==0)
tv_layerSet current
tv_warn "Layer sketch not found !"
END
Re: How to create a tool that selects a specific layer?
thanks Thierry, cool script and button freely configurable,
for the layer's name, as for the tool's type and settings
(just to mention it, a little mis-typing in your panel's name :
"select-sketcg", a "h" in place of the "g" would suit better)
for the layer's name, as for the tool's type and settings
(just to mention it, a little mis-typing in your panel's name :
"select-sketcg", a "h" in place of the "g" would suit better)
Last edited by ZigOtto on 28 Jul 2015, 09:06, edited 1 time in total.
Re: How to create a tool that selects a specific layer?
Woops, fixedZigOtto wrote:(just to mention it, a little mis-typing in your panel's name : "select-sketcg", a "h" in place of the "g" would suit better)
Re: How to create a tool that selects a specific layer?
ultra-fast service !
a last note about this handy tool :
if you have several layers with the same "sketch" name,
the script will select always the upper one.
a last note about this handy tool :
if you have several layers with the same "sketch" name,
the script will select always the upper one.