Time and Variables

I am trying to read the current frame into a variable for a MEL script I am working on but for some reson I cannot. Any ideas? How about a command to change the current frame. Thanks.

PaulS

$tmp = currentTime -q;/// read up on currentTime

Im interested in this topic.

Following your example above, what is stored in the $tmp variable, and how can it be read and further utilised?

Can you use it to access data for an object at the frame-number stored in $tmp. Or can you store data from a specific frame int $tmp with the syntax above?

Maybe this was not to eloquent, if it makes no sence, please forgive me.

T.

$tmp is a variable you declare. You assign it a value from the currentTime mel command. If the variable is declared as global, it will retain that value until you assign a new value or exit maya. If you don't declare it as global-the usual practice- it will retain its value only within the scope of the currently executing mel script.

float $tmp, $tmp2;
global float $tmp3;
$tmp = 'currentTime -query`;//assigns the current time to $tmp

$tmp2 = $tmp; // assigns $tmp value to $tmp2

$tmp3 = $tmp; // assigns $tmp value to global float $tmp3