Page 1 of 1

New tool: Adjust Line Width (by Stan)

Posted: Mon Nov 14, 2016 2:25 pm
by Stan
Image

Image

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

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Nov 16, 2016 5:24 am
by velu
Is there possible to change the line width and stroke show/hide as changing the width percentage?

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Nov 16, 2016 10:48 pm
by funksmaname
Awesome, this could be useful for scaling... thanks Stan! :)

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Nov 30, 2016 2:02 pm
by GaryC
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.

Re: New tool: Adjust Line Width (by Stan)

Posted: Fri Dec 02, 2016 5:11 am
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.

Re: New tool: Adjust Line Width (by Stan)

Posted: Tue Dec 06, 2016 5:09 pm
by hayasidist
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)

Posted: Wed Dec 07, 2016 4:43 am
by Stan
hayasidist wrote:Hi Stan - great tool (and I love the way you've handled localisation!! отлично!)
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: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?
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 :D )?

Re: New tool: Adjust Line Width (by Stan)

Posted: Sun Dec 11, 2016 1:42 am
by hayasidist
Yes - I was thinking shape but also setting all point width to 100% - so really a bit of both.

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)

Posted: Wed May 23, 2018 9:59 am
by DK
Stan. Thank you so much for this script. :D 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

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Jun 12, 2019 4:46 pm
by uncle808us
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

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Jun 12, 2019 5:29 pm
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.

Re: New tool: Adjust Line Width (by Stan)

Posted: Wed Jun 12, 2019 9:31 pm
by Greenlaw
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