AutoHotKey and Moho Menu Selection Question

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

User avatar
chucky
Posts: 3920
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by chucky » Sat Sep 09, 2017 9:45 pm

looks pretty good :D .
I suggest reload tools is a good one too , such a mashing of buttons for that shortcut.
I also find select layer and shape tools handy, but maybe just cos I can hover my left hand over the device rather than moving my stylus away from the action.
DO you have touch on the cintiq? I remember AHK was best on my EP121 which was pen and touch , I heard touch on cintiq is a little dodgy though..
But I'm still hoping the devs will just add this as a right-click command for the Layer Panel...this really needs to happen.)
Fingers crossed .

BTW, I'm way too cheap to buy a new peripheral for that screen, it's literally my phone, the cool thing is, because the cintiq has the usb port on the side, it's always charged and if someone calls the phones already right there attached by one of those wafer thin magnets ( well the magnet's on the cintiq it's just a metal dog tag thing on the phone).
Sequential offender.
my latest animations
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by synthsin75 » Sat Sep 09, 2017 10:07 pm

Greenlaw wrote:Thanks Wes. I know it's a really simple thing but this was a good 'get my feet wet' practice project for me.

Regarding the commands, it was a dumb user error. I mixed up ! and + in the shortcuts for those two buttons.

Wherever I can, I'm using the default shortcuts. I think there are just a few where I needed to configure my own.
Well, "simple" is always relative.

Yeah, I'd have to refresh my memory on which character is for which modifier.

Sticking to the default shortcuts is generally good, but then highly customized users will have trouble using it. Let me know if you need help maybe reading the Moho shortcuts file, or I can point you to some references that may help.
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sat Sep 09, 2017 10:15 pm

Thanks Chucky.

I use multi-touch on my Companion but the MQC's buttons are too small for my fingers on this computer. That's okay, I only ever intended to use a stylus or mouse with it, so no biggie. At work, our Cintiq 22HD tablets don't have touch.

For kicks, I just now tried pressing the buttons with a finger. Hey! The buttons do respond to touch for Moho! But my fingers are still too big to make this practical on the Companion's 13-inch screen.

In general, I really like multi-touch in Clip Studio Paint, and I like it in Moho Pro 12 with the new 'Navigation Only' mode enabled. (Without this option, multi-touch in ASP was crazy-making.)
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sat Sep 09, 2017 10:20 pm

synthsin75 wrote:Sticking to the default shortcuts is generally good, but then highly customized users will have trouble using it. Let me know if you need help maybe reading the Moho shortcuts file, or I can point you to some references that may help.
Thanks, Wes! That would be cool when I come back to this project. Right now I need to switch to a long neglected project but I want to come back to this one soon so I don't forget everything I just learned. :)

In the meantime, I'm going to release the current MQC after I record that video.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
chucky
Posts: 3920
Joined: Sun Jan 28, 2007 4:24 am
Location: Van Diemen's Land
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by chucky » Sun Sep 10, 2017 8:26 am

Oh Hey Dennis,
Have you tried my CSP brushes?
https://squarebrush.com/
Sequential offender.
my latest animations
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 9:46 am

Looks cool! I'll check them out as soon as I get a chance.

Just learned a neat scripting trick for the MQC button panel: now it remembers its previous screen position. Well, anyway I'm excited about that. :)

Still need to record that video. Right now I'm whipping up a demo scene for it.

Hope to post the tool tomorrow.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 10:23 am

Hey, Wes, I have an AHK question.

Right now the MQC.exe writes out an ini file for the panel's screen position. This works fine but if the MQC.exe is anywhere inside the Programs folder, then I need to set the .exe to run as Admin from the Properties window. Do you know how to set the privileges inside the script so the user doesn't have to deal with it? I've found examples elsewhere and didn't quite follow what was being done...but it's late so probably too tired. :)

I see I can probably use [RunAs, Administrator] before the line where the ini is saved, but the docs say "If the script is running with restricted privileges due to User Account Control (UAC), any programs it launches will typically also be restricted, even if RunAs is used. To elevate a process, use Run *RunAs instead."

Huh? Whuuu? Does that apply here? I probably should go to bed and deal with it tomorrow.

(Edit: Nah, added [RunAs, Administrator] but it doesn't seem to work as expected in Programs. And my account has Admin privileges. Saw another command called RunAsTask() but now I really am too tired.)

Thanks in advance for any suggestions.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 10:56 am

Oh, wait. I think I'm way overthinking this. I set the program's privileges before I copied the MQC folder to Programs and the setting seems to 'stick'. The, when I launched and quit the MQC.exe, it did save the .ini file while in the Programs folder.

I guess I should test this with a lower UAC setting and see if this still works. Tomorrow. I mean later this morning. For real this time. :)
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

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

Re: AutoHotKey and Moho Menu Selection Question

Post by synthsin75 » Sun Sep 10, 2017 5:45 pm

Personally, I'd just have the user put it in their custom content folder...probably in scripts/utility folder. But I guess there is a chance they could have created that in the Programs folder too. If setting it beforehand doesn't work, try this: https://autohotkey.com/docs/commands/Run.htm#RunAs

But depending on whether the system admin allows RunAs to be used, it may be easier to just specify the custom content folder...not in Programs.
And I'd just write the .ini to the same location as the .exe.


I've worked out how to get the users custom keyboard shortcuts, but not how to find either which file is used (if the user has multiple shortcut profiles) or the path to the user settings file (that tells me which one they're using).
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 9:04 pm

Thanks. Yeah, an IT friend of mine told me a while back that a program probably shouldn't be writing anything in the Program folder anyway, I guess Windows doesn't really like that, and it's better to write settings to a folder in the user folder or to another folder outside of Programs (like the custom content folder I guess.) I should listen to you guys. :)

Last evening, I just thought it would be good to keep it inside the Smith Micro folder and outside of the Moho folder, but that was before I added the .ini write code.

Of course, it's not necessary to put it in the Programs folder at all---the user can actually put it anywhere and make a shortcut of it. I'll add a note to the instruction so the user is aware of the consequences.
synthsin75 wrote:I've worked out how to get the users custom keyboard shortcuts, but not how to find either which file is used (if the user has multiple shortcut profiles) or the path to the user settings file (that tells me which one they're using).
Oh, geez! Thanks for looking into that. I wasn't expecting you to but I do appreciate the interest and effort. What I've done for now is just included an MQC.json file with the required shortcuts. The user can simply drop this in the Keyboard Shortcuts folder in his Content folder, and select it in Moho. Then he can decide if he wants to use it or copy the modified settings to his own settings. I think there are only three custom settings so it's really not that bad.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 9:12 pm

I also thought maybe I could have the program write and read the .ini in a specified folder in Documents regardless of where the program was located. But I've already spent way more time on this thing than I intended and I hope to move on to something else soon. :)

Right now I'm putting together a simple character for the demo scene, and using the tool to see if it's really gonna work out for me. So far so good.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

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

Re: AutoHotKey and Moho Menu Selection Question

Post by synthsin75 » Sun Sep 10, 2017 9:34 pm

Once you release it, I may make changes as I have the time (if you share the source .ahk file). Looks like something that could be made more robust and expanded upon.
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Sun Sep 10, 2017 9:41 pm

That would be fantastic! I was planning to include the uncompiled source and other materials in case anybody wanted to carry it further.

If you take it up, I would love to study your code and figure out what you did with it.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4383
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: AutoHotKey and Moho Menu Selection Question

Post by Greenlaw » Thu Sep 14, 2017 9:29 pm

Just a quick follow up:

I've been building a personal project character using the new tool, and it seems to work as intended.

The only issue I'm having is that the smallest buttons are too small on my 13" Wacom Cintiq Companion screen, even when the screen res is lowered to 1920 x 1080. For me, anyway, the smaller buttons are just a little hard to read and click on with a stylus. (It's fine on a full-size Cintiq 22HD at 1920 x 1080.)

I'm going to increase the height of the panel just a little bit, and will probably post the tool this weekend.
Last edited by Greenlaw on Thu Sep 14, 2017 11:44 pm, edited 2 times in total.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2017
Lead Digital Animator, Dreamworks Animation

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

Re: AutoHotKey and Moho Menu Selection Question

Post by synthsin75 » Thu Sep 14, 2017 11:31 pm

Cool, looking forward to it.

I have a week or so between jobs, and this might be something to play with.
Post Reply