Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Maxon Cinema 4D How to remove empty polygons

  • Andy Kiernan

    June 24, 2022 at 11:25 am

    select>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 pm

    Following Script from a guy at Cgsociety did the work for me.

    import c4d
    from c4d import documents as docs

    class ObjIter:

    def __init__(self, obj):
    self.obj = obj
    self.currObj = obj
    self.objStack = []

    def __iter__(self):
    return self

    def __next__(self):

    if not self.currObj:
    raise StopIteration

    obj = 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()

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy