Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am currently working on a script that can help me make every poly element of a particular materialID planar locally in a poly object that will loop over multiple objects. I have this so far:
PolyObj = selection as Array
for obj in PolyObj do
(
poSetFaceSelection = polyop.setFaceSelection
-- select material ID 1
$.selectByMaterial 1
-- sets the selected face indices as an array
flattenFaces = getFaceSelection $ as Array
print flattenfaces
-- function to clear selection
clearPolySel = polyop.SetFaceSelection $ #none
-- cycles through the list of faces to flatten then makes planar in Z
for i = 1 to flattenFaces.count do
(
clearPolySel
poSetFaceSelection $ flattenFaces[i]
$.MakePlanarIn #Z selLevel:#Face flag:1
)
)
currently the script in the body of the main for loop works when applied to a single object:
poSetFaceSelection = polyop.setFaceSelection
-- select material ID 1
$.selectByMaterial 1
-- sets the selected face indices as an array
flattenFaces = getFaceSelection $ as Array
print flattenfaces
-- function to clear selection
clearPolySel = polyop.SetFaceSelection $ #none
-- cycles through the list of faces to flatten then makes planar in Z
for i = 1 to flattenFaces.count do
(
clearPolySel
poSetFaceSelection $ flattenFaces[i]
$.MakePlanarIn #Z selLevel:#Face flag:1
)
I am currently trying to work out how to get it to work when having multiple objects.
what it should do is make elements that arent flat like this:
making it flat but still keeping the averaged height of the element:
any help regarding this would be much appreciated, thanks!
Solved! Go to Solution.