How to read Info of Maya file start time?


#1

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!

Thanks!


#2

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.


#3

Thanks!
The file is not opening, read file info. starttime and endtime etc.


#4

Please help me write some mel code.
Thanks!


#5

If you wish to use mel to read external files you could use

fopen

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 :slight_smile:


#6

No,no,no…

i don’t such …

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


#7

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`;


#8

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.