Created
October 28, 2019 12:36
-
-
Save rondreas/9dec122fc8c8004cb287ee53bfb6f821 to your computer and use it in GitHub Desktop.
Modo function for getting all visible meshes in current scene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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