PDA

View Full Version : Setting all viewports to show Edged Faces


Xoliul
12-16-2007, 12:44 PM
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?

drdubosc
12-16-2007, 06:51 PM
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..)

Xoliul
12-16-2007, 07:20 PM
I am actually using the correct method, otherwise it just errors out on me. Just a typo, so no change yet :)

RustyKnight
12-16-2007, 10:47 PM
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?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

Xoliul
12-17-2007, 04:34 PM
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.

Zbuffer
12-17-2007, 04:34 PM
Hi,
this works for me:
(
for i = 1 to viewport.numViews do
(
viewport.activeViewport = i
viewport.SetShowEdgeFaces (true)
)
redrawViews()
)

RustyKnight
12-17-2007, 10:36 PM
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

CGTalk Moderation
12-17-2007, 10:36 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.