Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created October 28, 2019 12:36
Show Gist options
  • Select an option

  • Save rondreas/9dec122fc8c8004cb287ee53bfb6f821 to your computer and use it in GitHub Desktop.

Select an option

Save rondreas/9dec122fc8c8004cb287ee53bfb6f821 to your computer and use it in GitHub Desktop.
Modo function for getting all visible meshes in current scene
import modo
# Anonymous function to wrap the lx query
is_visible = lambda item: bool(lx.eval('layer.setVisibility {} ?'.format(item.id)))
def get_visible_meshes():
meshes = modo.Scene().items(itype='mesh') # Get all mesh items in scene
return [mesh for mesh in meshes if is_visible(mesh)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment