View Full Version : How to query soundfileon TimeSlider ?

02 February 2011, 01:23 PM
Hi everyone,
I am not a coder,just an artist who is looking through MEL to learn a few basics.
I have made a button for making playblasts using the following code , which I got from a MEL script...

//get just the name and extenstion
string $theFile = `file -q -sn -shn`;

//minus the extension
string $theFileName = `basenameEx($theFile)`;

//Make the playblast MOV
playblast -format qt -filename ($theFileName) -forceOverwrite -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "mjpa" -quality 100;

Now I know about the -sound "string" command,but I dont know how to query the sound file currently displayed on the TimeSlider.

Could anyone help please.

02 February 2011, 02:38 PM
You need to use the timeControl command and give it the global timeControl objectUI. So normally it's:

global string $gPlayBackSlider;
timeControl -q -sound $gPlayBackSlider;

where $gPlayBackSlider is Maya's default timeline, this gets setup at boot so as long as you pass it in, it'll return the currently active audio.

03 March 2011, 12:29 PM
That works like a charm , thanks a lot. I checked your website , a lot of useful info over there , keep it coming.

I am putting together a collection of scripts and buttons to help me work faster. Should be useful for animators so will share it soon.Had this problem for a while , but now its solved.

Thanks again.

CGTalk Moderation
03 March 2011, 12:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.