PDA

View Full Version : Selecting faces with no smoothing group


nmcelmury
11-24-2008, 06:51 PM
Hi everyone, I'm looking for a way to select faces with no smoothing groups in an editable poly. I'm still a total beginner when it comes to Maxscripting so go easy on me. I can select smoothing faces that are assigned to smoothing groups without a problem, but for the life of me I can't figure out how to select faces with no assigned smoothing group.
Any help would be much appreciated!

Bobo
11-24-2008, 07:23 PM
Hi everyone, I'm looking for a way to select faces with no smoothing groups in an editable poly. I'm still a total beginner when it comes to Maxscripting so go easy on me. I can select smoothing faces that are assigned to smoothing groups without a problem, but for the life of me I can't figure out how to select faces with no assigned smoothing group.
Any help would be much appreciated!

The 32 smoothing groups are the 32 bits of a long integer stored per polygon.
So a face with no smoothing groups has a SG value of... zero!

I created a Box, collapsed to EPoly and cleared the Smoothing of a couple of sides.
After running the following code, I got those polygons without smoothing groups selected:

theObject = $Box01 --this is my object
polyOp.setFaceSelection theObject (for f = 1 to polyop.getNumFaces theObject where polyop.getFaceSmoothGroup theObject f == 0 collect f)
max views redraw --this refreshes the viewports to show the selection


You can turn this into a function:

fn selectFacesWithNoSG theObject =
(
polyOp.setFaceSelection theObject (for f = 1 to polyop.getNumFaces theObject where polyop.getFaceSmoothGroup theObject f == 0 collect f)
)

nmcelmury
11-24-2008, 07:47 PM
Thanks Bobo, that did the trick, much appreciated!

CGTalk Moderation
11-24-2008, 07:47 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.