*NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

I tried it now and I get the error: syn_dock_layers_set.lua:93: attempt to index local 'file' (a nil value)
Win10 Moho 13.5.1
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Daxel wrote: Fri Aug 13, 2021 10:38 pm I tried it now and I get the error: syn_dock_layers_set.lua:93: attempt to index local 'file' (a nil value)
Win10 Moho 13.5.1
Did you assign a shortcut to the "SYN: Dock Layers Use" button? That is required for auto-docking.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

synthsin75 wrote: Sat Aug 14, 2021 1:42 am
Daxel wrote: Fri Aug 13, 2021 10:38 pm I tried it now and I get the error: syn_dock_layers_set.lua:93: attempt to index local 'file' (a nil value)
Win10 Moho 13.5.1
Did you assign a shortcut to the "SYN: Dock Layers Use" button? That is required for auto-docking.
Yes. I get the error at Moho launch, then I assign the shortcut, but keep getting the error each time I select a different layer or press any of the dock layers buttons.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Daxel wrote: Sat Aug 14, 2021 10:14 am Yes. I get the error at Moho launch, then I assign the shortcut, but keep getting the error each time I select a different layer or press any of the dock layers buttons.
So you have a custom content folder and a custom shortcuts file in Moho Pro>Keyboard Shortcuts?
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

synthsin75 wrote: Sat Aug 14, 2021 9:09 pm
Daxel wrote: Sat Aug 14, 2021 10:14 am Yes. I get the error at Moho launch, then I assign the shortcut, but keep getting the error each time I select a different layer or press any of the dock layers buttons.
So you have a custom content folder and a custom shortcuts file in Moho Pro>Keyboard Shortcuts?
I have a custom content folder, and now that you mention that keyboard shortcuts folder, I've checked it out and I have that folder empty and another one (that I don't remember creating) called "Atajos de teclado" (the same but in spanish) where I have my custom shortcuts files. So I'm not sure if I created it long time ago or maybe Moho got confused between languages or versions. I just copied the shortcut files to the Keyboard Shortcuts folder and I don't get any errors now. Thanks for the help!

Edit: yeah it wasn't me! I deleted my "Atajos de teclado" folder and my shortcuts stopped being availible for Moho, so I tried creating a new keyboard shortcuts file and saw that Moho created it on a new "Atajos de teclado" folder. I don't know why it does that, if every other folder is still in english.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Daxel wrote: Sat Aug 14, 2021 10:07 pm I have a custom content folder, and now that you mention that keyboard shortcuts folder, I've checked it out and I have that folder empty and another one (that I don't remember creating) called "Atajos de teclado" (the same but in spanish) where I have my custom shortcuts files. So I'm not sure if I created it long time ago or maybe Moho got confused between languages or versions. I just copied the shortcut files to the Keyboard Shortcuts folder and I don't get any errors now. Thanks for the help!

Edit: yeah it wasn't me! I deleted my "Atajos de teclado" folder and my shortcuts stopped being availible for Moho, so I tried creating a new keyboard shortcuts file and saw that Moho created it on a new "Atajos de teclado" folder. I don't know why it does that, if every other folder is still in english.
There's the problem. The script has some folder names, like "Keyboard Shortcuts," hardcoded, so it won't work for other languages.
The only problem with copying the shortcut file to the folder the script expects is that those copies won't be updated if you change any shortcuts.

I can find the language being used in the user.settings file and use that to find the Keyboard Shortcuts folder name in the Strings files, but that will take me a bit to get around to.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

synthsin75 wrote: Sat Aug 14, 2021 11:20 pm
Daxel wrote: Sat Aug 14, 2021 10:07 pm I have a custom content folder, and now that you mention that keyboard shortcuts folder, I've checked it out and I have that folder empty and another one (that I don't remember creating) called "Atajos de teclado" (the same but in spanish) where I have my custom shortcuts files. So I'm not sure if I created it long time ago or maybe Moho got confused between languages or versions. I just copied the shortcut files to the Keyboard Shortcuts folder and I don't get any errors now. Thanks for the help!

Edit: yeah it wasn't me! I deleted my "Atajos de teclado" folder and my shortcuts stopped being availible for Moho, so I tried creating a new keyboard shortcuts file and saw that Moho created it on a new "Atajos de teclado" folder. I don't know why it does that, if every other folder is still in english.
There's the problem. The script has some folder names, like "Keyboard Shortcuts," hardcoded, so it won't work for other languages.
The only problem with copying the shortcut file to the folder the script expects is that those copies won't be updated if you change any shortcuts.

I can find the language being used in the user.settings file and use that to find the Keyboard Shortcuts folder name in the Strings files, but that will take me a bit to get around to.
I see. Thank you I would appreciate that but don't worry too much as I wanted to try this tool but I dont really need it.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

I've updated auto-dock for Windows. It should now work with other languages, but I haven't tested it to make sure.

Kicking myself for taking this long to think of just using MOHO.Localize.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

synthsin75 wrote: Thu Aug 26, 2021 8:40 pm I've updated auto-dock for Windows. It should now work with other languages, but I haven't tested it to make sure.

Kicking myself for taking this long to think of just using MOHO.Localize.
I can confirm that solved the language problem. I finally tried the tool and it works great.

There are two minor inconvenients that you may want to know: the first is that it is not taking the camera values into account. At first I couldn't get it to work and after trying some things turned out that reseting all camera properties solved the issue. The second is that the tool slows down zooming with the mouse wheel. It looks like it happens because the mouse wheel produces a lot of little successive zooms in and the tool tries to run its logic after each one of them.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Daxel wrote: Thu Aug 26, 2021 10:22 pm I can confirm that solved the language problem. I finally tried the tool and it works great.

There are two minor inconvenients that you may want to know: the first is that it is not taking the camera values into account. At first I couldn't get it to work and after trying some things turned out that reseting all camera properties solved the issue. The second is that the tool slows down zooming with the mouse wheel. It looks like it happens because the mouse wheel produces a lot of little successive zooms in and the tool tries to run its logic after each one of them.
Thanks for checking it out.

It shouldn't be affected by the camera, as it sets the docked layer to be immune to camera. Docked layers should be top level layers, not in group/bone/etc. layers that might be influenced by the camera.

Yeah, in order to auto-dock when zooming, I have to pass the mouse wheel input through the script. When I get time, I'll see if there's a way to pass on all the mouse wheel inputs but auto-dock less frequently.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Updated again. This *should* keep auto-dock from making mouse wheel zoom lag. It will now auto-dock about half a second after you quit scrolling the mouse wheel.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by Daxel »

synthsin75 wrote: Thu Aug 26, 2021 10:48 pm It shouldn't be affected by the camera, as it sets the docked layer to be immune to camera. Docked layers should be top level layers, not in group/bone/etc. layers that might be influenced by the camera.
I had the camera zoomed in on frame 0, the docked layer was on top of everything and not in group or anything. When I tried to dock it, it always got docked at the wrong place until I reseted the camera zoom values.
synthsin75 wrote: Fri Aug 27, 2021 4:46 am Updated again. This *should* keep auto-dock from making mouse wheel zoom lag. It will now auto-dock about half a second after you quit scrolling the mouse wheel.
The link seems to be broken. Error 404.
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by hayasidist »

synthsin75 wrote: Thu Aug 26, 2021 8:40 pm I've updated auto-dock for Windows. It should now work with other languages, but I haven't tested it to make sure.

Kicking myself for taking this long to think of just using MOHO.Localize.
(a bit OT) -- but are any other folder/file names localised?! I can't seem to find entries in the localisation files for any except keyboard shortcuts (/Application/KeyboardShortcuts) and the text for Menu items (such as Edit / Edit Keyboard Shortcuts) also aren't in those files (so I'm guessing they're in the "core" of the application)???

((oh and just in case you don't see the previous post -- link is broken 404))
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

Daxel wrote: Fri Aug 27, 2021 10:00 am I had the camera zoomed in on frame 0, the docked layer was on top of everything and not in group or anything. When I tried to dock it, it always got docked at the wrong place until I reseted the camera zoom values.
That's because the layer is not immune to camera when you position it, but then immune after you add it.
So if you position and add it again, once it's already immune to camera, it will stay where you put it.
The link seems to be broken. Error 404.
Damn it. Google flagged it as a virus, even though the AHK source file is included. I'm waiting for it to be reviewed on appeal.
Last edited by synthsin75 on Fri Aug 27, 2021 9:48 pm, edited 2 times in total.
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW-ish* Dock Layers to workspace (Auto-dock on Windows)

Post by synthsin75 »

hayasidist wrote: Fri Aug 27, 2021 12:53 pm (a bit OT) -- but are any other folder/file names localised?! I can't seem to find entries in the localisation files for any except keyboard shortcuts (/Application/KeyboardShortcuts) and the text for Menu items (such as Edit / Edit Keyboard Shortcuts) also aren't in those files (so I'm guessing they're in the "core" of the application)???

((oh and just in case you don't see the previous post -- link is broken 404))
That's the only file name I've found that is localized.

Yeah, Google flagged the exe in the zip, mistaking it for a virus. Google's dumb.
Post Reply