Activity › Forums › Maxon Cinema 4D › How to remove empty polygons
-
How to remove empty polygons
Posted by ton vogels on June 24, 2022 at 10:15 amI imported a 3D file with a lot of empty polygons.
How can I possibly delete them all at ones?
ton vogels replied 4 years, 1 month ago 2 Members · 2 Replies -
2 Replies
-
Andy Kiernan
June 24, 2022 at 11:25 amselect>delete… next question!
Sorry no, maybe you can use the mesh checker – attributes window, mode>modeling>mesh checker, then use that to select, if it works. Or maybe use phong select then invert? Im guessing sorry
-
ton vogels
June 27, 2022 at 7:46 pmFollowing Script from a guy at Cgsociety did the work for me.
import c4d
from c4d import documents as docsclass ObjIter:
def __init__(self, obj):
self.obj = obj
self.currObj = obj
self.objStack = []def __iter__(self):
return selfdef __next__(self):
if not self.currObj:
raise StopIterationobj = self.currObj
if self.currObj.GetDown():
self.objStack.append(self.currObj.GetNext())
self.currObj = self.currObj.GetDown()
else:
self.currObj = self.currObj.GetNext()
while not self.currObj and len(self.objStack) > 0:
self.currObj = self.objStack.pop()return obj
def main():
doc = docs.GetActiveDocument()
obj = doc.GetFirstObject()
scene = ObjIter(obj)for obj in scene:
if isinstance(obj, c4d.PolygonObject) and obj.GetPointCount() == 0 and not obj.GetDown():
obj.Remove()
c4d.EventAdd()if __name__ == ‘__main__’:
main()
Reply to this Discussion! Login or Sign Up