New tool: Adjust Line Width (by Stan)
Moderators: Víctor Paredes, Belgarath, slowtiger
New tool: Adjust Line Width (by Stan)
The tool allows to adjust the line width by adding/subtracting a value or by multiplying/dividing by a provided coefficient.
It works for the entire selected layer(s), and supports vector layers and all types of group layers (including switch, bone, etc.) with any nesting depth.
Works with Moho 12 (and should work with previous versions, but it wasn't tested).
Download here: http://mohoscripts.com/script/sz_adjust_line_width
Last edited by Stan on Sun Dec 27, 2020 6:41 am, edited 1 time in total.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
Re: New tool: Adjust Line Width (by Stan)
Is there possible to change the line width and stroke show/hide as changing the width percentage?
I love Moho
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
Re: New tool: Adjust Line Width (by Stan)
Awesome, this could be useful for scaling... thanks Stan!
Re: New tool: Adjust Line Width (by Stan)
There is a small changed needed to get this working in version 11.
You use "LM.GUI:Divider(true)" a few times when building the layout. In version 11 this raises an error about the first argument not being a boolean.
It expects you to use "LM.GUI.Divider(true)" instead. When I made that change it worked fine. (on lines 87, 102, 113 and 120)
I quickly tested using LM.GUI.Divider in 12 and it seems to work fine there, so I'm not sure if there's a downside to calling it that way.
You use "LM.GUI:Divider(true)" a few times when building the layout. In version 11 this raises an error about the first argument not being a boolean.
It expects you to use "LM.GUI.Divider(true)" instead. When I made that change it worked fine. (on lines 87, 102, 113 and 120)
I quickly tested using LM.GUI.Divider in 12 and it seems to work fine there, so I'm not sure if there's a downside to calling it that way.
Re: New tool: Adjust Line Width (by Stan)
Thank you GaryC! I always forget that module functions are used with a dot, not colon. Good catch!
The URL in the first post is updated.
The URL in the first post is updated.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
- hayasidist
- Posts: 3521
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: New tool: Adjust Line Width (by Stan)
Hi Stan - great tool (and I love the way you've handled localisation!! отлично!) A really useful enhancement to this would be to have an option to set the line width at each point to 100% and have the default stroke width altered accordingly (e.g. if I have a shape where the default line width is 20, and I scale down to 20% of that it would be useful to have the default stroke width set to 4 and the point widths at 100%) Is that feasible?
Re: New tool: Adjust Line Width (by Stan)
Thank you! I came up with that approach a couple years ago, and now all my scripts use that localization method. It would not just automatically translate the script's UI to Russian, but also makes it easy to translate to other languages as well. And it should be pretty fast too (performance-wise).hayasidist wrote:Hi Stan - great tool (and I love the way you've handled localisation!! отлично!)
So, are you asking about modifying the shape's style line width instead of the point's one? I think that can be done, but I don't think it should be done within this script. Maybe another tool, or menu script? Or maybe I didn't understand your question correctly and you can add some clarifications (like pictures, or, knowing you, some code examples, maybe )?hayasidist wrote:A really useful enhancement to this would be to have an option to set the line width at each point to 100% and have the default stroke width altered accordingly (e.g. if I have a shape where the default line width is 20, and I scale down to 20% of that it would be useful to have the default stroke width set to 4 and the point widths at 100%) Is that feasible?
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
- hayasidist
- Posts: 3521
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: New tool: Adjust Line Width (by Stan)
Yes - I was thinking shape but also setting all point width to 100% - so really a bit of both.
So in meta code
So in meta code
Code: Select all
Get desired stroke width
For each layer
For each shape
Set stroke width
End
For each point
Set point width = 100%
End
End
Re: New tool: Adjust Line Width (by Stan)
Stan. Thank you so much for this script. It has saved me hours of work manually adjusting line sizes on several characters to fit into background art. It should be built into the program b y the dev team at SM.
Cheers
D.K
Cheers
D.K
http://www.creativetvandmedia.com
My store on Renderosity:
https://www.renderosity.com/mod/bcs/?uid=921315
My store on Renderosity:
https://www.renderosity.com/mod/bcs/?uid=921315
- uncle808us
- Posts: 386
- Joined: Tue Apr 07, 2009 1:00 pm
- Location: USA
- Contact:
Re: New tool: Adjust Line Width (by Stan)
How do you install this on a MacBook Pro OSX El Capitan Ver 10.11.6
Anime Studio Pro Ver.11.2.1
Thank you
Anime Studio Pro Ver.11.2.1
Thank you
I use a MacBook Pro, and Anime Studio Pro 11.2
http://uncle808s.blogspot.com
http://uncle808s.blogspot.com
Re: New tool: Adjust Line Width (by Stan)
Sorry, I don't know anything about Macs, never used them. I can guess if you have the Content Folder you can just put the .lua and .png files into the scripts > tool folder there. Maybe someone with Mac experience will have a better answer.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
Re: New tool: Adjust Line Width (by Stan)
This might help: there's a basic walkthrough for installing a script in Moho in my 'Introduction to Layer Shortcuts' video. This info should be the same for ASP 11. The video features Windows but the procedure should be the same for Mac, the only difference being the path you chose when you set up the content folder. If you haven't set a content folder yet, you can do that from the Preferences window.
The video is here:
viewtopic.php?f=9&t=32882&p=187802&hili ... ts#p187802
The video is here:
viewtopic.php?f=9&t=32882&p=187802&hili ... ts#p187802
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion