*UPDATED 3/1/19* Layer Shortcuts tool

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by synthsin75 »

The workspace buttons would probably work well with my dock layers script too, so you can keep the buttons "attached" to the main window.

viewtopic.php?p=183041#p183041
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by Greenlaw »

Hi Wes,

I have a question about using Layer Shortcuts for multiple characters. I only got to play with this for a few minutes at lunch today and at one point I had a different Layer Switch group working for each of two characters. Then, before I ran out of time, one of the Layer Shortcuts groups stopped working. I'm pretty sure I did something to break it but, to be honest, I'm not sure how I even got the two Layer Shortcuts groups working in the first place. I just sort of randomly did stuff until it worked.

I'll give it another go at home tonight when I'm not feeling rushed and can work more methodically. But until then, what's the intended procedure for setting up two Layer Shortcut groups in the same project?

If you need to see what I'm doing, I'll try to record a video tonight.

Thanks for any info!
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by Greenlaw »

I re-read the instructions and I think I broke it because I had some default layer names in the second character. I'm not sure but the Layer Shortcuts probably stopped working properly when I created a group that had the same name as a layer inside the group. (Something generic like 'Layer 2'.) Maybe the Layer Shortcuts for this character will start working again after I give these layers unique names.

Will let you know after I get a chance to revisit this test.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by Greenlaw »

Ok, after my last post, I had a better idea how I broke it and couldn't resist spending a couple of minutes looking at the project again and...

...yay! I think figured it out. Yup, it was mostly about the layer naming but I think I may have also accidentally set the wrong group as the 'top' for the second character. After I straightened that out and corrected the names, the two Layer Shortcuts groups worked correctly for each character.

Will spend more time on this tonight and record the video after I take a closer look and feel a little more like I know what I'm doing. :P
Last edited by Greenlaw on Sun Jul 25, 2021 11:04 pm, edited 1 time in total.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by synthsin75 »

I should have an update to make this more robust tomorrow. I just need to use unique layer IDs instead of layer names.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by Greenlaw »

Just in time for the weekend! :D

Thanks, Wes. Yeah, that should prevent potential conflicts. I'm looking forward to trying it when it's ready.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by synthsin75 »

Sorry, the update is going to be delayed. I've made it more robust and added a new feature, but I need to make some existing behavior more consistent with the additions.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *HUGE UPDATE* Layer Shortcuts tool

Post by Greenlaw »

No worries! I'm enjoying what's already here. :)
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by synthsin75 »

https://sites.google.com/site/synthsin/ ... ects=0&d=1

New features as of version 2.3
  • Up/Down Arrows to select through the layers.
  • Universal checkbox (in Scope dropdown) - If checked, the button will match any layer with the same name in any group (behavior prior to v 2.3). This can be useful for setting up master shortcut buttons that work for all characters. That way instead of having a "left hand" button for each character, the same "left hand" button will work for whatever character group you are currently in.
  • Non-universal buttons will now ONLY select the layer they are assigned to, regardless of multiple layers with the same name, or even changing the layer name (although that won't update the button label*).

*v2.4 will now update non-universal note button name if its assigned layer name changes.
Last edited by synthsin75 on Tue Mar 05, 2019 6:24 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by Greenlaw »

Awesome, Wes! I'm especially interested in the non-universal buttons and will give it a try at lunchtime.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by synthsin75 »

Greenlaw wrote:Awesome, Wes! I'm especially interested in the non-universal buttons and will give it a try at lunchtime.
Make sure you have v2.4, since I made a quick addition so non-universal note buttons update if you change their assigned layer's name.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by Greenlaw »

Took a short break to try a tiny test with the new 'non-universal button' feature:

Made two 'character' groups, each with identically named layers inside. Make a set of buttons for each character contained inside each character's group. Clicking either of the identically named buttons selects the correct layer for each character.

As always, amazing work Wes! :D

At lunchtime, I'll try updating the buttons in an actual character I've been working on.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by synthsin75 »

Greenlaw wrote:At lunchtime, I'll try updating the buttons in an actual character I've been working on.
I'm not sure there's a good way to update buttons aside from deleting and recreating them, as the non-universal buttons require setting layer script data when they're created.

I can say that any further updates to this script, if any, will be compatible with buttons v2.4 creates. So maybe there's some solace in only having to recreate older buttons once.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by Greenlaw »

Thanks for the heads up. Yeah, I think I discovered that in my quick test this morning. The project file was actually a setup for a previous test and I had to recreate the buttons with 2.4 to make them work. No biggie...creating new buttons only took a few seconds.

I wasn't sure if this was expected to happen so thanks for confirming it.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *UPDATED 3/1/19* Layer Shortcuts tool

Post by Greenlaw »

I didn't get to work on it at lunch but here's a little more info about my earlier test for anybody using Layer Shortcuts 2.4.

When I created the new buttons, they appeared in a new Shortcuts group, but I was able to move the layers to the Shortcuts groups that already existed for each character. Seemed to work fine.

Wes, can you confirm that moving the layers to the older groups is okay to do? Is there something I should be aware of when doing this?
Post Reply