Not applicable
03-11-2018
08:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I wanted to re-iterate a check for nurbs, joints, motiontrails and locators in a viewport and if they are visible, I want maya to turn it off . Here is what I did,
import maya.cmds as cmds #check viewport panelnow=cmds.getPanel(wf=True) #items to hide in a list thingstoHide = ['nurbsCurves', 'joints','motionTrails','locators'] # for loop to check through all 4 items on top. for i in range(4): print thingstoHide[i] thingCheck = cmds.modelEditor(panelnow, query=True, thingstoHide[i]=True) if thingCheck == True : cmds.modelEditor(panelnow,edit=True, thingstoHide[i]=False) else : print "%s is already hidden " % thingstoHide[i]
But it seems impossible to use a list for keyword arguments is it true? am i getting anything wrong? or is there a better way to do this?
Solved! Go to Solution.
Link copied