Skip to content

Instantly share code, notes, and snippets.

@JFlynnXYZ
Last active August 29, 2015 14:09
Show Gist options
  • Save JFlynnXYZ/8c3c5edfb871d809b97a to your computer and use it in GitHub Desktop.
Save JFlynnXYZ/8c3c5edfb871d809b97a to your computer and use it in GitHub Desktop.
List Shape/Mesh Relatives for Selected Objects and Render Pass Primary Visibility
#Creats a list of all selected objects name of shape/mesh node
import maya.cmds as cmds
cmds.listRelatives(cmds.ls(selection=True), type='mesh')
#Changes primary visibility for the currently selected objects on the current render layer
import maya.cmds as cmds
for shape in cmds.listRelatives(cmds.ls(selection=True), type='mesh'):
cmds.setAttr('%s.primaryVisibility' % shape, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment