Korchkidu
Korchkidu

Reputation: 4946

Maya API: how to change UI Time Working Unit

I need to change the time working unit of Maya using the API. (see Window->Settings/Preferences->Preferences->Settings->Working Units->Time)

So I do:

  MTime::Unit mayaTime = MTime::k120FP;
  status = MTime::setUIUnit(mayaTime);

        [import some animated data]

  // For debug
  MTime::Unit tm = MTime::uiUnit();

tm is k120FPS so it is ok. Also, animated data are ok. BUT, when I open the GUI, time working units is still the default one...

The documentation says: "MTime::setUIUnit: Set the unit system to be used by the user in the UI. After the successful completion of this method, Maya's timeslider will be displaying frames in the specified units."

Do you see what I did wrong here?

Thanks for any help.

Upvotes: 2

Views: 966

Answers (1)

Maz
Maz

Reputation: 764

Try setting the optionVar "workingUnitTime".

Upvotes: 1

Related Questions