Batch Edge MakePlanar script? -- (MaxScript Beginner)


#1

HI everybody, just joined this awesome forum!
As stated in the title, I’m a 3D Environment Artist trying to learn scripting and MaxScript from scratch (long term would like to be a Tech Artist in my company)

Here I’m trying to do a batch MakePlanar in Z, on all the Edges in my current selection.

So far I have this :

obj = getCurrentSelection ()
edges = getEdgeSelection ()
		for i in edges do
		(
            edges.EditablePoly.SetSelection #Edge #{i}
			edges.EditablePoly.MakePlanarIn #Z 
		)

Which returns an error. I’m trying to achieve what’s indicated in the image . Any idea how to have this result?

Thanks a lot!


#2

get the verts that compose each of the edges and set thier z coord as the average z positon
in case if edge selection contains loops of edges you’ll need to first find separate edge groups and flatten them individually

Perhaps getContinuousEdgeGroups from this thread might be helpful for your task