*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
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

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

Post by Greenlaw »

I'm running Layer Shortcuts in Moho 13.5. I believe it was slightly modified though. Let me check.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

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

Post by Greenlaw »

Yeah, I have a comment at the top stating:

-- NOTE: this version has shortcut keys disabled to prevent
-- a mysterious LUA error. Code from 513 to 614 is disabled
-- Wes is looking into this.

That whole section is, indeed, commented out in my copy. I think this was done for Moho 13.0 compatibility, and then I forgot about it because it worked fine for me.

Quick fix is to make a copy of the script and remove the following lines from 511 to 612 (these are the lines in the original unedited script.)

I'm not sure the official release includes this hack. If not maybe Wes will update it properly if we ask nicely. (And when he has the time, of course.) :)

Edit: See Wes' note below.
Last edited by Greenlaw on Wed Apr 28, 2021 7:02 pm, edited 3 times in total.
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

EricTheFish wrote: Wed Apr 28, 2021 6:17 pm Out of curiosity I had a look at the LUA script and found it refers to "/Smith Micro/" on lines 514 and 516.

Does this mean the script will need an update to work with v13.5 now that "Smith Micro" is no longer in the app install path?
Yeah, I had to hard code the path, since Moho didn't provide that to the scripting API. 13.5 now does, but I have other scripting work before I can get to that.
In the meantime, I've added the changes Dennis mentioned to the official release. This means that keyboard shortcuts will not work (which Dennis doesn't use), but all the buttons will work without errors.
User avatar
EricTheFish
Posts: 85
Joined: Thu Jun 15, 2017 4:37 pm
Location: Lymm, UK

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

Post by EricTheFish »

synthsin75 wrote: Wed Apr 28, 2021 6:58 pm This means that keyboard shortcuts will not work (which Dennis doesn't use), but all the buttons will work without errors.
I commented out those lines and the script buttons are now working as you described. Thanks Wes! :)
EricTheFish
Artist, musician, animator, coder and dabbler in stuff
www.tech-nique.co.uk
User avatar
rafael
Posts: 129
Joined: Thu Feb 11, 2016 4:51 am
Location: Nomad
Contact:

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

Post by rafael »

Fantastic! I was just researching scripting in Moho in the hopes that layer selection could be made easier. This will save me a lot of wrist pain--many thanks!!!

P.S. I'm curious, would it possible to link the visibility of a group like this to a hotkey, so you only view the buttons when you need to make a selection?
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

rafael wrote: Tue Jun 15, 2021 8:51 pm Fantastic! I was just researching scripting in Moho in the hopes that layer selection could be made easier. This will save me a lot of wrist pain--many thanks!!!

P.S. I'm curious, would it possible to link the visibility of a group like this to a hotkey, so you only view the buttons when you need to make a selection?
Glad you find it useful.

I *might* be able to make it so that the button layers are only visible when the tool is selected. I'll have to look into that.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

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

Post by Greenlaw »

That might be cool!

But if you do, maybe make it optional? I'll have to look at one of my rigs that use Layer Shortcuts and see if the reduced clutter is helpful. Since many of my rigs at work get animated by other artists, I might want the buttons to be visible all the time so the artists know they exist.

(Actually, I've never used Layer Shortcuts on a rig at my workplace. I'll have to ask if we're allowed to install the script there. This tool is just too useful not to have.)
User avatar
rafael
Posts: 129
Joined: Thu Feb 11, 2016 4:51 am
Location: Nomad
Contact:

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

Post by rafael »

Greenlaw wrote: Tue Jun 15, 2021 11:06 pm That might be cool!
It's a pretty handy feature that's popped-up in some of the various 3D softwares I've used. In Cinema4D, for instance, you can hit a specific key and have the cooresponding menu pop-up next to wherever your cursor is. That said, I know this was made by a member of the community, and I have zero expectations. It's incredibly helpful to me as it is! :mrgreen:
User avatar
davoodice2
Posts: 381
Joined: Tue Jun 15, 2021 1:14 pm

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

Post by davoodice2 »

hi.
still crashs moho 13.5.1
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

davoodice2 wrote: Sun Jul 25, 2021 3:47 pm hi.
still crashs moho 13.5.1
Unless you want to post some steps to reproduce the problem, you're just pissing into the wind. As far as I know, your system is just especially unstable.
At the very least, an example file with the problem might be a start.
Last edited by synthsin75 on Sun Jul 25, 2021 7:08 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

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

Post by Greenlaw »

davoodice2 wrote: Sun Jul 25, 2021 3:47 pm still crashs moho 13.5.1
Yes, it would help if you can provide reproduceable steps. Just saying it crashes isn't enough information to begin troubleshooting.

FWIW, I've been animating with Layer Shortcuts in Moho 13.5.1, off and on, for a few months, and it's been very stable for me.

That said, I haven't fully rigged a new character using Layer Shortcuts in 13.5.1 yet; my current Layer Shortcuts characters were rigged using Moho 12.5. I'll put something together today using 13.5.1 and see how it goes.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

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

Post by Daxel »

I'm trying this out for the first time and the tool is amazing! Thank you.

About the "set/remove group button", you say "Use this in case the top of the group you want to navigate within is inside another group". I'm not sure if I understand. Is there an official shortcut like "select top/parent layer" or something like that? I looked for it on the shortcuts panel and on the official manual but didn't find anything.

davoodice2 wrote: Sun Jul 25, 2021 3:47 pm hi.
still crashs moho 13.5.1
It's being stable here. Try disabling the auto-save feature, that worked for me.

Víctor Paredes wrote: Thu Feb 21, 2019 1:45 pm Ps: It's also funny, because in CS we were talking about a very similar concept to create shortcuts in the software. The idea was to drag a layer over the screen to have a shortcut floating there.
Hey that would be super cool.
User avatar
synthsin75
Posts: 9979
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

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

Post by synthsin75 »

Daxel wrote: Mon Jul 26, 2021 11:42 am I'm trying this out for the first time and the tool is amazing! Thank you.

About the "set/remove group button", you say "Use this in case the top of the group you want to navigate within is inside another group". I'm not sure if I understand. Is there an official shortcut like "select top/parent layer" or something like that? I looked for it on the shortcuts panel and on the official manual but didn't find anything.
You can set local or global shortcuts. Local shortcuts are limited to a group, but you have to set which group or it will assume it's the topmost group of the layer.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

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

Post by Daxel »

synthsin75 wrote: Mon Jul 26, 2021 6:16 pm You can set local or global shortcuts. Local shortcuts are limited to a group, but you have to set which group or it will assume it's the topmost group of the layer.
ah got it, thank you.
User avatar
lucasfranca
Posts: 128
Joined: Sat Oct 07, 2017 11:47 pm

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

Post by lucasfranca »

synthsin75 wrote: Mon Jan 21, 2019 8:35 pm
This update is the same link: https://sites.google.com/site/synthsin/ ... ects=0&d=1
Latest version: 2.6
This link is off?
An old guy [since 1983] who was raised in front of the TV.
Passionate about animation, after getting old, he decides to make it his hobby.

I share tutorials, reviews, tips and tricks from this vast world of animation on my channel.

https://youtube.com/animai2D
Post Reply