# import python maya commands
import maya.cmds as cmds
# Create a list of ALL viewports
viewports = cmds.getPanel( all = True)
# Get the current viewport
vp = cmds.getPanel( withFocus = True) # current viewport
current = cmds.modelEditor( vp, q = True, nurbsCurves = True)
for view in viewports:
if 'modelPanel' in view:
# check to see if the item in lists is a viewport
# is one of the model panels.
# The list is quite big and we only need up to four
print view # prints the current viewport
#Swap the NURBS visibility around
cmds.modelEditor( view, edit = True, nurbsCurves = not(current))
我会回答我自己的问题:
在视口中循环
我希望这对我和你一样有帮助。是的。谢谢
相关问题 更多 >
编程相关推荐