「Select All Objects in the camera view」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
#highlight(python){{
import maya.OpenMaya as OpenMaya
import maya.OpenMayaUI as OpenMayaUI
def selectAllVisibleObjectsFromScreen():
activePane=OpenMayaUI.M3dView.active3dView()
w=activePane.portWidth()
h=activePane.portHeight()
myX=OpenMaya.MScriptUtil()
myX.createFromInt(0)
myY=OpenMaya.MScriptUtil()
myY.createFromInt(0)
myEndX=OpenMaya.MScriptUtil()
myEndX.createFromInt(w)
myEndY=OpenMaya.MScriptUtil()
myEndY.createFromInt(h)
OpenMaya.MGlobal.selectFromScreen(
myX.asShortPtr(),
myY.asShortPtr(),
myEndX.asShortPtr(),
myEndY.asShortPtr(),
OpenMaya.MGlobal.kReplaceList
)
}}