1
1

More than 1 year has passed since last update.

python maya current camera

Posted at
import maya.cmds as mc

def camLock():
    currentMP = mc.playblast(activeEditor =True)
    currentMP = currentMP.split("|")[-1]
    currentCam = mc.modelPanel(currentMP, q=True, camera=True)
    currentCamShape = mc.listRelatives(currentCam)
    print(currentCamShape)
    focalLength = mc.getAttr("{}.focalLength".format(currentCam))
    print(focalLength)
    aperture = cmds.getAttr(currentCam + '.cameraAperture')
    print(aperture)

camLock()
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1