Saturday, 2 March 2013

Make Planar per face

Scenario:
  • you have skewed faces across your geometry
  • you want to perform a make planar operation for each face
Usage:
  • select one or more objects or faces
  • run script
  • faces are made planar
Limitations:
  • Will not work on "edit poly" modifier. needs to be a collapsed editable poly.

  
-- MixeScript snippet: make planar per face
-- performs the make planar operation on each face of the selection

--USAGE
-- select one or more objects or faces
-- run script
-- faces are made planar

-- SETTINGS
numrepeats = 3

--if face selection mode
if subobjectLevel == 4 then 
(
 --only on selected faces
 obj = $
 thisfaceselection = polyop.getFaceSelection obj
 
 for i=1 to numrepeats do 
 (
  for eachface in thisfaceselection do ( polyop.makeFacesPlanar obj #(eachface))
 )
)

else 
(
 --all faces
 objarray = getcurrentselection() 
 
 for obj in objarray do 
 (
  for repeats=1 to numrepeats do 
  (
   for i=1 to (polyop.getNumFaces obj)do(polyop.makeFacesPlanar obj #(i))
  )
 )
)
RedrawViews()
 

No comments:

Post a Comment