2017-11-05 1 views
0

나는 modelPanel3 선택의 뷰포트입니다루프 모든 것을 현재보기 포트

modelEditor -e -nurbsCurves $b modelPanel3; 

으로 특정 창에 NURBS보기를 전환 할 수 있습니다.

어떻게하면 의 모든 뷰포트가 표시됩니까? 배열과 같은 정보를 반환해야 할 대상이 있습니까? 아니면 숫자를 반복하여보고 포트 가시성이 true인지 확인해야합니까?

답변

0

그때 나는 내 자신의 질문을 답변 해 드리겠습니다 : 반복하려면

을 뷰포트 나는 그게 당신처럼 나에게 많은 도움이 희망

# 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)) 

을 통해. 예. 감사합니다.

관련 문제