View Full Version : How to read Info of Maya file start time?

08 August 2008, 12:18 PM
How to access Info of Maya file start time? isn't scene file of current open.

Read a Maya .ma or .mb file info.

get Min Max Playback time.

Please help me!


08 August 2008, 02:07 AM
I'm not sure if I understand your question.
Do you want to get the start time of a Maya file without opening it?
If it's an ma file you can read this kind of info in any text program.

08 August 2008, 03:17 AM
The file is not opening, read file info. starttime and endtime etc.

08 August 2008, 03:18 AM
Please help me write some mel code.

08 August 2008, 11:05 AM
If you wish to use mel to read external files you could use
to open the file via Maya.

Then you could loop through the lines in the documents like this (from the example files):

$fileId=`fopen $exampleFileName "r"`;
string $nextLine = `fgetline $fileId`;
while ( size( $nextLine ) > 0 ) {
print ( $nextLine );
$nextLine = `fgetline $fileId`;

What you need to add though is a check. You need to match startTime and endTime with the string the loop returns for each line and then grab the data.

I haven't tried it out, but that's my theory :)

08 August 2008, 11:09 AM

i don't such .............

Read maya file info, as if start time or end time etc. It's not extern text file.

08 August 2008, 12:10 PM
oh... You just want the info after opening a file?
Then you go:

string $ah_getMinTime = `playbackOptions -q -min`;
string $ah_getStartTime = `playbackOptions -q -ast`;
string $ah_getMaxTime = `playbackOptions -q -max`;
string $ah_getEndTime = `playbackOptions -q -aet`;

CGTalk Moderation
08 August 2008, 12:10 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.