gunner89
11-22-2010, 10:11 AM
Hey, ive only just started to use python and am having some trouble with getting the if statement syntax right. What i want this code to do is: if "pCube1" is visible, hide it. If it is hidden, show it. My code obviously doesnt work, can someone show me how to amend the if getAttr.pCube1.visible=true part? The toggleVisibility("pCube1") is what i want to type to run the function.
Thanks
p, li { white-space: pre-wrap; } import maya.cmds as cmds
if cmds.getAttr("pCube1", visibile=True)
def toggleVisibility(object):
cmds.hide(object)
elif
cmds.showHidden(object)
toggleVisibility("pCube1")
Thanks
p, li { white-space: pre-wrap; } import maya.cmds as cmds
if cmds.getAttr("pCube1", visibile=True)
def toggleVisibility(object):
cmds.hide(object)
elif
cmds.showHidden(object)
toggleVisibility("pCube1")
