Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Selecting only parallel faces...
show user profile  Manolo
I'm working on a simple city model,like a hundred blocks of it actually. All the outlines of the properties has been extruded and joined in a single editable poly.
Now I have to pick -in sub object mode- just the roofs. I don't mind if get the floors too: Is there a way to pick only the xy parallel polygons?

Thanks. Cheers.

Manolo
read 708 times
1/22/2009 6:44:28 PM (last edit: 1/22/2009 6:44:28 PM)
show user profile  Sypher-5
I think someone wrote a script to do this, my memory is a bit scratchy today so I cant help you any futher sorry.
Signature Pending Redesign

read 703 times
1/22/2009 6:50:36 PM (last edit: 1/22/2009 6:50:36 PM)
show user profile  Toen
With the poly object selected try running this script:


pObj=$
flatPolys=#{}
polyOpGetFaceNormal=polyOp.getFaceNormal
for i=1 to (polyOp.getNumFaces pObj) do (
polyNormal=polyOpGetFaceNormal pObj i
if (polyNormal==z_axis or polyNormal==-z_axis) then (
flatPolys[i]=true
)
)
polyOp.setFaceSelection pObj flatPolys
redrawViews()
read 688 times
1/22/2009 7:27:40 PM (last edit: 1/22/2009 7:27:40 PM)
show user profile  markoid
Handy script Toen... yoink... thanks :)



read 674 times
1/22/2009 8:00:44 PM (last edit: 1/22/2009 8:00:44 PM)
show user profile  Manolo
Thanks a lot. I'm trying it tomorrow for today it was 2000+ faces by hand and I'm home already.

Cheers,

Manolo
read 673 times
1/22/2009 8:12:00 PM (last edit: 1/22/2009 8:12:00 PM)
show user profile  Dub.
There is my faceflood script which you might find handy as well
http://www.maxforums.org/thread.aspx?tid=543767



read 670 times
1/22/2009 8:30:32 PM (last edit: 1/22/2009 8:30:32 PM)
show user profile  Garp
Arg... Dub! You posted while I was writing it!
Oh well, here is my version: http://www.scriptspot.com/3ds-max/parallel-polys

edit: and Toen too. I'm definitely too slow.




read 658 times
1/22/2009 11:28:54 PM (last edit: 1/22/2009 11:39:50 PM)
show user profile  Manolo
OK guys, 1st of all I want to state that my experience with maxscript is 0 (shame on me).

That said, I selected the poly object, opened the listener and paste Toen's script, then enter. Nothing happened. So I selected one of the polygons -one of the desired "parallels" and entered the script again. An encouraging "ok" appeared at the bottom, and that's it.

Dub, that script looks quite handy, for I face those issues constantly. Nice!

Garp, I did the same as with Toens', and a syntax error appeared.

Thanks dudes, I reckon that maxscript can -at least theorically- be a powerful tools.

BTW, If I did something wrong -probably- while "applying" the scripts, please let me know.

Cheers,

Manolo
read 614 times
1/23/2009 3:55:37 PM (last edit: 1/23/2009 3:55:37 PM)
show user profile  Toen
Oh hey,
To run multi-line scripts like that select 'MAXScript' -> 'New Script' from the top menu in Max. That will open a new maxscript editor window, past the code in there and then hit Ctrl-E to run it.

You can also put that kind of code into a button on any open menu bar by highlighting all of the code in the editor window and then click-dragging it onto any menu bar open in 3ds max. Then whenever you click on that particular button it will execute the code. You can modify that button or delete it by right clicking on the button selecting the appropriate option, you can also edit the script in the button that way too, change how it looks, it's text, etc.
read 588 times
1/23/2009 5:42:35 PM (last edit: 1/23/2009 5:47:03 PM)
show user profile  Manolo
Great! thanks very much, Toen.

Cheers,

Manolo
read 577 times
1/23/2009 6:43:46 PM (last edit: 1/23/2009 6:43:46 PM)
show user profile  Garp
If you download and save a script on your hard drive, you can run it with Run Script in the maxscript menu.




read 569 times
1/23/2009 7:22:53 PM (last edit: 1/23/2009 7:22:53 PM)
show user profile  Dave
Toen, is that a "Select Similar" script?

"I flew over Egypt once"

read 548 times
1/24/2009 2:11:25 PM (last edit: 1/24/2009 2:11:25 PM)
show user profile  Toen
I guess you could call it that, is that some kind of scripting paradigm?
It selects only the polygons that have their face normals pointing in the same direction as the z-axis. So you could say it's based on the polygon face normals being similar (exactly equal to in this case) to a unit vector pointing in the negative or positive z-axis direction.
read 543 times
1/24/2009 3:21:58 PM (last edit: 1/24/2009 3:24:24 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org