ジャンプ先: 概要. 戻り値. フラグ. Python 例.

概要

sound( [objects] , [endTime=time], [file=string], [length=boolean], [mute=boolean], [name=string], [offset=time], [sourceEnd=time], [sourceStart=time])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

sound は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

サウンド スクラブおよび再生中のサウンドをサポートする soundControl や timeControl などの UI コマンドで使用できる オーディオ ノードを作成します。

戻り値

string 作成されたオーディオ ノードの名前

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

endTime, file, length, mute, name, offset, sourceEnd, sourceStart
ロング ネーム(ショート ネーム) 引数型 プロパティ
file(f) string createqueryedit
サウンド ファイルの名前です。
offset(o) time createqueryedit
サウンドを起動する時間です。
endTime(et) time createqueryedit
サウンドを終了する時間です。
sourceStart(ss) time createqueryedit
サウンドを開始する位置にあるサウンド ファイルの先頭からのオフセット時間。
sourceEnd(se) time createqueryedit
サウンドを終了する位置にあるサウンド ファイルの先頭からのオフセット時間。
name(n) string createqueryedit
作成するオーディオ ノードに付与する名前です。
length(l) boolean query
サウンドの長さ(カレント タイム単位)です。
mute(m) boolean createqueryedit
オーディオ クリップをミュートします。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

import maya.cmds as cmds

# Create an audio node for a sound file, and have it
# start at time 10.  This command will return the name
# of the created node, something like "audio1".
#
cmds.sound( offset=10, file='ohNo.aiff' )

# In order to have this sound displayed in a
# timeControl widget (like the timeSlider) use a
# command like this one, where the global MEL variable
# $gPlayBackSlider is the name of the widget to display
# the sound in.
#
import maya.mel
gPlayBackSlider = maya.mel.eval( '$tmpVar=$gPlayBackSlider' )
cmds.timeControl( gPlayBackSlider, edit=True, sound='audio1' )