私は、自分の質問にお答えします:ビューポートをループし
# 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))
私はそれはあなたがしたように私は同じくらい助けたことを願っています。はい、そうでした。ありがとうございました