0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

maya python カメラを選択

Last updated at Posted at 2022-09-02
import maya.cmds as cmds

# Get all cameras first
cameras = cmds.ls(type=('camera'), l=True)

# Let's filter all startup / default cameras
startup_cameras = [camera for camera in cameras if cmds.camera(cmds.listRelatives(camera, parent=True)[0], startupCamera=True, q=True)]

# non-default cameras are easy to find now.
non_startup_cameras = list(set(cameras) - set(startup_cameras))

# Let's get their respective transform names, just in-case
non_startup_cameras_transforms = map(lambda x: cmds.listRelatives(x, parent=True)[0], non_startup_cameras)
cmds.select(non_startup_cameras_transforms)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?