Share
 
 

How do I get or set the position along the timeline using MEL?

You can set the current time with the command.

You can query the command to return the current time in a format controlled by the command.

The following commands store the current time in seconds in the $time variable:

// Save the current time unit in a variable
string $timeFormat = `currentUnit -query -time`;
// Set the current time unit to seconds
currentUnit -time sec;
// Store the current time in $time
float $time = `currentTime -q`;
// Restore the original time unit we saved earlier
currentUnit -time $timeFormat;

Was this information helpful?