How to make a Toggle script for these two commands?

How to make a Toggle script for these two commands?

yCekyLL
Contributor Contributor
690 Views
3 Replies
Message 1 of 4

How to make a Toggle script for these two commands?

yCekyLL
Contributor
Contributor

I need these two commands: "Defaull Shading" and "Facets", to work with the same "toggle" shortcut.
Can anyone help me by making a script for this ?

001.jpg
___________________________

In older versions of this it was possible through the
"Wireframe / Smooth HighlightsToggle" and
"Wireframe / Facet Shading Toggle".

There have been a lot of improvements to the preview modes these days, which is great!! - But it would help me a lot to have a script making these two switchable commands in a single hotkey.

0 Likes
Accepted solutions (2)
691 Views
3 Replies
Replies (3)
Message 2 of 4

10DSpace
Advisor
Advisor
Accepted solution

@yCekyLL 

 

The toggle script you requested is attached.  Note that I followed your request literally in that the toggle switch only switches between default smooth shading and faceted.  So if the currently selected viewport is in a different state (e.g., wireframe)  nothing happens.  If you want to customize the script further here is the link to the relevant page in the Maxscript docs:

 

https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-8AA71F9E-F4F0-4437-A44E-9683619E89DE#viewp...

 

To install the script unzip the attached and drag Vprt_Smooth_Facet_Toggle.mcr  into a  viewport.  Then assign a hotkey via the Customize User Interface menu.

 

Message 3 of 4

yCekyLL
Contributor
Contributor

10DSpace, I really appreciate it!!
I've been working with Max and other APPS for over 20 years and I've never had help with scripting problems.
I'm developing some projects for teaching and your script was perfect and will help a lot!

Cy_04.jpg

0 Likes
Message 4 of 4

10DSpace
Advisor
Advisor
Accepted solution

@yCekyLL 

 

Glad to help.  If you are interested in learning more about Maxscript, checkout the video series by John Wainwright here:

 

http://www.scriptspot.com/3ds-max/tutorials/maxscript-101-free-online-training

 

Also @Swordslayer has some very useful tips for Maxscripting here:

 

http://creativescratchpad.blogspot.com/2011/06/maxscript-one-liners-for-artists.html