Maya中通过代码获取当前摄摄像机的若干方法(不间断更新)

第一种:

import maya.OpenMaya as OpenMaya
import maya.OpenMayaUI as OpenMayaUI
def _get_camera_name():
    '''获取当前相机名
    '''
    view = OpenMayaUI.M3dView.active3dView()
    camDag = OpenMaya.MDagPath()
    view.getCamera(camDag)
    camera = camDag.fullPathName()
    name= cmds.listRelatives(camera, parent = True)[0]

        return name

 
  

你可能感兴趣的:(Pipeline的初长成,maya,python)