def updateBlockAffordances(polyData=None):

    for obj in om.getObjects():
        if isinstance(obj, BoxAffordanceItem):
            if 'refit' in obj.getProperty('Name'):
                om.removeFromObjectModel(obj)

    for obj in om.getObjects():
        if isinstance(obj, BoxAffordanceItem):
            updateBlockFit(obj, polyData)
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/updateBlockAffordances/original