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: Víctor Paredes, Belgarath, slowtiger

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

Button script to swap the view to Wireframe and back

Post by Stan »

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
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
velu
Posts: 47
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 »

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: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

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

Post by jahnocli »

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

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

Post by Stan »

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?
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
velu
Posts: 47
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 »

Thank you very much San!

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

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

Post by toonscale »

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: 199
Joined: Sun Apr 19, 2009 3:22 pm

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

Post by Stan »

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
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
velu
Posts: 47
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 »

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: 199
Joined: Sun Apr 19, 2009 3:22 pm

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

Post by Stan »

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
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
velu
Posts: 47
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 »

Hi San,

Thank you very much!
I love Moho
Post Reply