一半君的总结纸

听话只听一半君

#45 How do I toggle playback between “Normal” and “Free” while playback is running? It only seems to take effect when I restart playback at the beginning.

The trick is to stop and restart the playback within the MEL that toggles the Playback Option:

// Is the animation currently playing?
int $isPlaying = `play -q -state`;

// If so, stop.
if ( $isPlaying )
  play -state off;

// Toggle playback mode between "Free" and "Normal"
playbackOptions -ps ( !`playbackOptions -q -ps` );

// If the animation was playing, resume playing with new mode
if ( $isPlaying )
  play -state on;

Related How-To’s

Monday, October 23, 2000

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 博主赞过: