Skip to content

Instantly share code, notes, and snippets.

@hexagit
Created June 26, 2018 12:14
Show Gist options
  • Save hexagit/4bb062daf0abae0ef9ace1af424d1dbe to your computer and use it in GitHub Desktop.
Save hexagit/4bb062daf0abae0ef9ace1af424d1dbe to your computer and use it in GitHub Desktop.
Mayaで現在のカメラに表示されているメッシュを選択する
# -*- coding: utf-8 -*-
#===========================================
# 現在のカメラに表示されているオブジェクトを選択する
#===========================================
import maya.OpenMaya as om_1
import maya.OpenMayaUI as omUI_1
# 現在選択されているビューの取得
currentView = omUI_1.M3dView.active3dView()
# 選択ビューからのモデルの取得
om_1.MGlobal.selectFromScreen( 0, 0, currentView.portWidth(), currentView.portHeight(), om_1.MGlobal.kReplaceList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment