Poly make planar, again

I could really use a function that made all selected polygons planar to the average (of the selected poly's) normal.

In 3ds max this is called "make planar".

So, first I must find out the average normal, and then I need to scale them to 0 along that axis. Possible? Should be...

The workaround I'm using now is to delete the edges inside the area I want to make planar, and then scale that one poly flat (via mel). This has many drawbacks, obviously, and sometimes has me rebuilding the whole area.

Any help would be much appreciated.

/Claes

Come on people, help me out here

Ok, i got my vector (normal) and my pivot. But how do I scale it along that axis?

Nobody who wants this function? Really?

/Claes

I'll keep talking to myself...

Is the only way to do this to rotate the object so that the calculated normal vector is aligned with world x, y or z, freeze transforms, scale, rotate back and freeze again?

/Claes

here's one way to do it:

*get all the selected faces' normals
*calculate the average normal
*get the faces' boundingbox center and use this as a point on your plane
*using the plane equation you can calculate each vertex's distance to the plane
*move these vertices that distance along the negated normal

DOH or use the planarize plugin on this site!

Well, i guess there's not may people reading this forum... I almost got it there...

On the positive side I learned a bit of mel

Thanks
Claes