Last active
April 28, 2016 07:19
-
-
Save fredrikaverpil/310145480e5de0618d8a428afe161b11 to your computer and use it in GitHub Desktop.
Set V-Ray proxy geometry type
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 maya.cmds as cmds | |
def set_selected_geotype(n): | |
""" Source this function in Maya, then run one of the following: | |
set_selected_geotype(n=0) # Placeholder | |
set_selected_geotype(n=1) # Bounding box | |
set_selected_geotype(n=2) # Preview | |
set_selected_geotype(n=3) # Maya mesh | |
set_selected_geotype(n=4) # GPU Cache | |
""" | |
for proxy in cmds.ls(sl=True, long=True): | |
relatives = cmds.listRelatives(proxy, fullPath=True) | |
for relative in relatives: | |
connections = cmds.listConnections(relative, type='VRayMesh') | |
if not isinstance(connections, type(None)): | |
for obj in connections: | |
cmds.setAttr(obj+'.geomType', n) |
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 maya.cmds as cmds | |
def set_all_geotype(n): | |
""" Source this function in Maya, then run one of the following: | |
set_all_geotype(n=0) # Placeholder | |
set_all_geotype(n=1) # Bounding box | |
set_all_geotype(n=2) # Preview | |
set_all_geotype(n=3) # Maya mesh | |
set_all_geotype(n=4) # GPU Cache | |
""" | |
for proxy in cmds.ls(type='VRayMesh', long=True): | |
cmds.setAttr(proxy+'.geomType', n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment