Delete empty visibility layers ============================== This script delete visibility layers (also called geometry layers) that contains no surfaces. .. literalinclude:: DeleteEmptyVisibilityLayers.py :linenos: :download:`Download example ` :py:func:`delete_layer_if_empty` is a `post-order recursive`_ function. It does the following: * Recurse into direct sub layers of the layer. * Delete the layer if it contains no surfaces and no sub layers (i.e. it is empty). The empty child layers are already removed by the recursive step. .. _post-order recursive: https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(LRN)