一半君的总结纸

听话只听一半君

#27 如何查询/设置 Time Slider 和 Range Slider?

查询 Time Slider 上高亮选择的范围:

global string $gPlayBackSlider;
float $rangeArray[2];
$rangeArray = `timeControl -q -rangeArray $gPlayBackSlider`;
// Result: 1 2 //

设置 Time Slider 上高亮选择的范围:

据我所知,没有办法. 我曾经用 ‘timeControl’ command试过,只会出现错误提示 (在 MayaNT v2.5.1里).

global string $gPlayBackSlider;

string $range = `timeControl -q -range $gPlayBackSlider`;
// Result: "93:229" //
timeControl -e -range $range $gPlayBackSlider;
// Error: line 1: Too many arguments.  Expected 1, found 2. //

float $rangeArray[2] = `timeControl -q -rangeArray $gPlayBackSlider`;
// Result: 93 229 //
timeControl -e -rangeArray $rangeArray $gPlayBackSlider;
// Error: line 1: Invalid object or value:  //

查询 Range Slider:

float $minTime = `playbackOptions -q -minTime`;
// Result: 1 //
float $maxTime = `playbackOptions -q -maxTime`;
// Result: 30 //

设置 Range Slider:

float $minTime = 12.0;
float $maxTime = 18.5;
playbackOptions -minTime $minTime -maxTime $maxTime;
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: