script for calling a layer based on its name
- malcooning
- Posts: 2114
- Joined: 29 Mar 2006, 12:43
- Location: Tel Aviv
- Contact:
script for calling a layer based on its name
I'm currently working on a certain project that uses many layers. As well, I have a toolbar with preset tools that I constantly access. Every time I select a tool, I select a different layer that is associated with that tool (because I need to keep the elements on separate layers). As I go between the different layers and their associated tools, I find myself spending alot of time and energy in searching for the particular needed layer in the tower of layers.
is there a script line that can call a particular layer based on the layer name? (in this way, I could just add the line to each of my tools in the toolbar, which will select the corresponding layer whenever I select the tool)
is there a script line that can call a particular layer based on the layer name? (in this way, I could just add the line to each of my tools in the toolbar, which will select the corresponding layer whenever I select the tool)
Asaf | asafagranat.com
- Paul Fierlinger
- Posts: 8100
- Joined: 03 May 2008, 12:05
- Location: Pennsylvania USA
- Contact:
Re: script for calling a layer based on its name
Mark, aka lemec, (and I, come to think of it) once started a mini layers tree script. This was way back at the beginning of Mirage. It almost worked but wasn't quite bug free. Maybe Mark could post it here again and see if it would be worth further development (I think it would and should be considered as a new feature even). With this little gadget you could hide the entire layer panel and do all the navigating through this mini version which really took up very little space.
Paul
http://www.slocumfilm.com
Desktop PC Win10-Pro -64 bit OS; 32.0 GB RAM
Processor: i7-2600 CPU@3.40GHz
AMD FirePro V7900; Intuos4 Wacom tablet
http://www.slocumfilm.com
Desktop PC Win10-Pro -64 bit OS; 32.0 GB RAM
Processor: i7-2600 CPU@3.40GHz
AMD FirePro V7900; Intuos4 Wacom tablet
- malcooning
- Posts: 2114
- Joined: 29 Mar 2006, 12:43
- Location: Tel Aviv
- Contact:
Re: script for calling a layer based on its name
I remember that mini layers tree. Functioned like a pop-up, if I recall well.
But if I get your description right, it doesn't solve my need. I'm worried less about space, and more about running up and down the layers column and clicking many times. what I need is something to select a particular layer when I click a custom button.
only one click > to select the tool + the corresponding layer.
But if I get your description right, it doesn't solve my need. I'm worried less about space, and more about running up and down the layers column and clicking many times. what I need is something to select a particular layer when I click a custom button.
only one click > to select the tool + the corresponding layer.
Asaf | asafagranat.com
Re: script for calling a layer based on its name
Helps this action?
its 2 line you alter the first one to input the name of the layer(default its outline)
and then it should select the first layr with that name
-mads
its 2 line you alter the first one to input the name of the layer(default its outline)
and then it should select the first layr with that name
-mads
- Attachments
-
- getLayerWithName.tvpx
- (6 KiB) Downloaded 805 times
Re: script for calling a layer based on its name
script tested, and it works like a charm...
thanks Mads !
to avoid to have to edit the custom button when we want to set a new Layer name,
I've added a basic "Set Layer Name" button (using a tv_ReqString command),
here's the tvpx file.
a pity the layers window doesn't auto-scroll (Up/Down) to the new current layer
when this one is outside of the visibility area in the timeline panel .
thanks Mads !
to avoid to have to edit the custom button when we want to set a new Layer name,
I've added a basic "Set Layer Name" button (using a tv_ReqString command),
here's the tvpx file.
a pity the layers window doesn't auto-scroll (Up/Down) to the new current layer
when this one is outside of the visibility area in the timeline panel .
- Attachments
-
- curLayerByNamePanel.png (2.51 KiB) Viewed 16229 times
-
- curLayerByName.tvpx
- (98 KiB) Downloaded 764 times
- malcooning
- Posts: 2114
- Joined: 29 Mar 2006, 12:43
- Location: Tel Aviv
- Contact:
Re: script for calling a layer based on its name
Mads, thanks a lot. it's a good short script. It will save me quite a lot of time.
Zig, your tvpx file doesn't install any of your george files. The only one I can see is the one from Mads. can you upload the grg files only please?
Zig, your tvpx file doesn't install any of your george files. The only one I can see is the one from Mads. can you upload the grg files only please?
Asaf | asafagranat.com
Re: script for calling a layer based on its name
Cool madsmalcooning wrote:Mads, thanks a lot. it's a good short script. It will save me quite a lot of time.
Re: script for calling a layer based on its name
weird ... again some troubles with sharing tvpx between different computers ...malcooning wrote:Zig, your tvpx file doesn't install any of your george files. The only one I can see is the one from Mads. can you upload the grg files only please?
anyway, here's the 2 george files :
- Attachments
-
- George.rar
- (591 Bytes) Downloaded 794 times
- malcooning
- Posts: 2114
- Joined: 29 Mar 2006, 12:43
- Location: Tel Aviv
- Contact:
Re: script for calling a layer based on its name
yes, it seems this interface needs to be improved promptly.ZigOtto wrote:weird ... again some troubles with sharing tvpx between different computers
thanks for the files.
now, I seem to make it work for one button, but when I try to use it on a few different button (each calls a different layer) I fail to understand how to make it work. do you mind writing a short step-by-step please?
cheers.
Asaf | asafagranat.com
Re: script for calling a layer based on its name
its the problem with zigotto approach that it only works with one button,
and because one cant detect through scripting witch action button is pressed you have to use my approach.
Isnt that true Zig?
-mads
and because one cant detect through scripting witch action button is pressed you have to use my approach.
Isnt that true Zig?
-mads
Re: script for calling a layer based on its name
exactly,
if you want to store several buttons, each one dedicated to one specific layer name,
the original Mads button (with 2 commands embeded) is the way to go.
My approach was a bit different, you can use the same button to call the same layer at any times,
and you change the target (setlayername button) to point a different (new) layer.
guessing your own need, I think you should stay stuck with Mads approach,
duplicate the button, edit the first command, and save it with a new name (the new layer's name),
make as many buttons as needed.
if you want to store several buttons, each one dedicated to one specific layer name,
the original Mads button (with 2 commands embeded) is the way to go.
My approach was a bit different, you can use the same button to call the same layer at any times,
and you change the target (setlayername button) to point a different (new) layer.
guessing your own need, I think you should stay stuck with Mads approach,
duplicate the button, edit the first command, and save it with a new name (the new layer's name),
make as many buttons as needed.
- malcooning
- Posts: 2114
- Joined: 29 Mar 2006, 12:43
- Location: Tel Aviv
- Contact:
Re: script for calling a layer based on its name
i'm glad to see my understanding of the scripts was not falling far from their logics
i've added Mads's script + layer calling line to my existing button, and it sure is an improvement in workflow.
just for reference, what I'm doing is I'm illustrating a children books of +40 pages. almost in each double-page spread the main 2 characters are showing. I'm drawing the characters on separate dedicated project (see attachment), and then I place them in the main illustration. This allows me to have each part of a character on a dedicated layer, which saves me having all the layers of the character included into the main illustration, which itself has many layers. so I have a custom panel with different tools to draw the different parts of the character (a panel for each character), and the script allows me to select the corresponding layer when I select the tool.
i've added Mads's script + layer calling line to my existing button, and it sure is an improvement in workflow.
just for reference, what I'm doing is I'm illustrating a children books of +40 pages. almost in each double-page spread the main 2 characters are showing. I'm drawing the characters on separate dedicated project (see attachment), and then I place them in the main illustration. This allows me to have each part of a character on a dedicated layer, which saves me having all the layers of the character included into the main illustration, which itself has many layers. so I have a custom panel with different tools to draw the different parts of the character (a panel for each character), and the script allows me to select the corresponding layer when I select the tool.
Asaf | asafagranat.com