Button script to swap the view to Wireframe and back

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

Post Reply
Stan
Posts: 132
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Button script to swap the view to Wireframe and back

Post by Stan » Sun May 31, 2020 9:35 pm

Image

A button-script to quickly change the view to Wireframe and back.

If you want a different mode than Wireframe, you can easily alter it inside the script file (lines 49-51 will guide you through).

Download here: http://mohoscripting.com/uploads/1/sz_s ... w_mode.zip
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
velu
Posts: 45
Joined: Sun Jun 22, 2008 10:52 am
Location: India - Chennai
Contact:

Re: Button script to swap the view to Wireframe and back

Post by velu » Mon Jun 01, 2020 9:50 am

Is it possible while working "Transform point tool" if we press "swap view mode" (with assigned shortcut key) and when release return to "Transform point tool" selection instead of "swap view mode" tool selection.

Many thanks.
I love Moho
User avatar
jahnocli
Posts: 3384
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Button script to swap the view to Wireframe and back

Post by jahnocli » Mon Jun 01, 2020 12:31 pm

Thanks Stan!
You can't have everything. Where would you put it?
Stan
Posts: 132
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Re: Button script to swap the view to Wireframe and back

Post by Stan » Tue Jun 02, 2020 1:16 am

velu wrote:
Mon Jun 01, 2020 9:50 am
Is it possible while working "Transform point tool" if we press "swap view mode" (with assigned shortcut key) and when release return to "Transform point tool" selection instead of "swap view mode" tool selection.

Many thanks.
That's exactly how it works now. Isn't it?
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
velu
Posts: 45
Joined: Sun Jun 22, 2008 10:52 am
Location: India - Chennai
Contact:

Re: Button script to swap the view to Wireframe and back

Post by velu » Tue Jun 02, 2020 5:23 am

Thank you very much San!

It is working what I expected.
I love Moho
toonscale
Posts: 2
Joined: Fri May 08, 2020 1:19 am

Re: Button script to swap the view to Wireframe and back

Post by toonscale » Thu Jun 04, 2020 2:29 am

Thanks for the script. really handy but would have been nice if we could define our wireframe view cos i personally would like to have *STROKES showing.
Stan
Posts: 132
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Re: Button script to swap the view to Wireframe and back

Post by Stan » Thu Jun 04, 2020 3:27 am

toonscale, you can easily customize the script for your own preferences.
Open the script's .lua file with a "plain text" editor (I recommend Notepad++), and find the following line:

Code: Select all

SZ_SwapViewMode.modeToSwap = MOHO.LDQ_WIREFRAME
(If your text editor is capable of showing line numbers, it's line 51)

So, to make it strokes instead of wireframe, change the line to the following:

Code: Select all

SZ_SwapViewMode.modeToSwap = MOHO.LDQ_OUTLINES
The entire list of available options can be found here: http://mohoscripting.com/modules/MOHO#L ... ay_quality

You can combine multiple options using a plus sign, for example:

Code: Select all

SZ_SwapViewMode.modeToSwap = MOHO.LDQ_OUTLINES + MOHO.LDQ_LABELS
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
velu
Posts: 45
Joined: Sun Jun 22, 2008 10:52 am
Location: India - Chennai
Contact:

Re: Button script to swap the view to Wireframe and back

Post by velu » Mon Jun 08, 2020 8:00 am

Hi, When selecting "swap view mode" image layer also hiding. Is it possible only the selected object will be in wireframe mode like layer visible on/off.
I love Moho
Stan
Posts: 132
Joined: Sun Apr 19, 2009 3:22 pm
Contact:

Re: Button script to swap the view to Wireframe and back

Post by Stan » Mon Jun 08, 2020 4:06 pm

velu wrote:
Mon Jun 08, 2020 8:00 am
Hi, When selecting "swap view mode" image layer also hiding. Is it possible only the selected object will be in wireframe mode like layer visible on/off.
You can try changing the line 51 to:

Code: Select all

SZ_SwapViewMode.modeToSwap = MOHO.LDQ_WIREFRAME + MOHO.LDQ_IMAGES
________________________________________________________________________
http://mohoscripting.com/ - Unofficial Moho (Anime Studio) Lua Scripting Documentation
http://2danimator.ru/ - Russian Anime Studio Forum
velu
Posts: 45
Joined: Sun Jun 22, 2008 10:52 am
Location: India - Chennai
Contact:

Re: Button script to swap the view to Wireframe and back

Post by velu » Tue Jun 09, 2020 7:50 am

Hi San,

Thank you very much!
I love Moho
Post Reply