[Closed] Setting all viewports to show Edged Faces
Hi guys.
Just writing my first Maxscript, an automatic blueprint creator intended for setting up (vehicle) blueprints in about 5 seconds instead of the usual 5-10 minutes. It’s almost done, but there’s a last feature I want to add to it. When you use blueprints, you alwyas want them to show as edged faces in all your views. Now, since my script is meant to be used on a blank, vanilla file, this means none of the viewports are set to edged faces by default.
I tried to write a little for-loop to set these, but it doesn’t seem to work. Judging by the reference, i’m not doing anything wrong…
here’s what i have:
for i = 1 to viewport.numViews do
(
viewport.activeViewport = i
viewport.SetShowEdgeFaces (true)
)
Extremely simple, yet I get no result. Changing the active viewport works, but the SetShowEdgedFaces doesn't do anything. Using the actionMan.executeAction 0 "369" command also doesn't work for all viewports, it only does it on one of them then.
Any help?
for i = 1 to viewport.numViews do
(
viewport.activeViewport = i
viewport.SetShowEdgedFaces (true)
)
I’m no expert, but there is a misprint there … the method is
viewport.SetShowEdgeFaces <boolean> –( no ‘d’ at the end of …Edge…)
I am actually using the correct method, otherwise it just errors out on me. Just a typo, so no change yet
I haven’t tried this, but you might want to look up “Refreshing the Viewports” in the docs.
Shane
ps – The script seems to work find for me, except, I’m not sure if it is actually what you want. When I run script, nothing appears to happen, except when I select an object, not only do I get the normal bounding box, the edge faces are also highlighted…
pps – I’m using max 9
Well, what I want is to save the user the trouble of having to press F3 and F4 up to 4 times to switch to Edged Faces display mode for all the viewports.
I’ll look at the viewport refreshing reference.
Hi,
this works for me:
(
for i = 1 to viewport.numViews do
(
viewport.activeViewport = i
viewport.SetShowEdgeFaces (true)
)
redrawViews()
)
Hi Xoliul!
I had a quick look at what the function keys did and the code you’ve got replicates the f4 key.
You might want to tyy Zbuffer’s suggestion and see where it gets you.
Shane