// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Table that content string use by the command currrentUnit -t. // Keep it sync with $gTimeUnitDisplayTable. // string $gCurrentTimeCmdValueTable[] = { "2fps", "3fps", "4fps", "5fps", "6fps", "8fps", "10fps", "12fps", "game", "16fps", "20fps", "23.976fps", "film", "pal", "29.97fps", "29.97df", "ntsc", "40fps", "47.952fps", "show", "palf", "59.94fps", "ntscf", "75fps", "80fps", "90fps", "100fps", "120fps", "125fps", "150fps", "200fps", "240fps", "250fps", "300fps", "375fps", "400fps", "500fps", "600fps", "750fps", "1200fps", "1500fps", "2000fps", "3000fps", "6000fps", "44100fps", "48000fps" }; // // Add milliseconds, seconds, minutes, hours if you need them // int $gHideNoFPSFramerateExists = `optionVar -exists hideNoFPSFramerate`; int $gHideNoFPSFramerate = `optionVar -q hideNoFPSFramerate`; if($gHideNoFPSFramerateExists == 1 && $gHideNoFPSFramerate != 1) { int $size = size($gCurrentTimeCmdValueTable); $gCurrentTimeCmdValueTable[$size] = "millisec"; $gCurrentTimeCmdValueTable[$size+1] = "sec"; $gCurrentTimeCmdValueTable[$size+2] = "min"; $gCurrentTimeCmdValueTable[$size+3] = "hour"; } // // Return the table that content list of string use to display FPS in UI. // Keep it sync with $gCurrentTimeCmdValueTable. // global proc string[] getTimeUnitDisplayStringTable() { string $timeUnitDisplayTable[] = { (uiRes("m_workingTimeUtil.kTwoFps")), (uiRes("m_workingTimeUtil.kThreeFps")), (uiRes("m_workingTimeUtil.kFourFps")), (uiRes("m_workingTimeUtil.kFiveFps")), (uiRes("m_workingTimeUtil.kSixFps")), (uiRes("m_workingTimeUtil.kEightFps")), (uiRes("m_workingTimeUtil.kTenFps")), (uiRes("m_workingTimeUtil.kTwelveFps")), (uiRes("m_workingTimeUtil.kFifteenFps")), (uiRes("m_workingTimeUtil.kSixteenFps")), (uiRes("m_workingTimeUtil.kTwentyFps")), (uiRes("m_workingTimeUtil.kTwentyThreeNineSevenSixFps")), (uiRes("m_workingTimeUtil.kFilm")), (uiRes("m_workingTimeUtil.kPAL")), (uiRes("m_workingTimeUtil.kTwentyNineNineSevenFps")), (uiRes("m_workingTimeUtil.kTwentyNineNineSevenDF")), (uiRes("m_workingTimeUtil.kNTSC")), (uiRes("m_workingTimeUtil.kFortyFps")), (uiRes("m_workingTimeUtil.kFortySevenNineFiveTwoFps")), (uiRes("m_workingTimeUtil.kShow")), (uiRes("m_workingTimeUtil.kPALField")), (uiRes("m_workingTimeUtil.kFiftyNineNineFourFps")), (uiRes("m_workingTimeUtil.kNTSCField")), (uiRes("m_workingTimeUtil.kSeventyfiveFps")), (uiRes("m_workingTimeUtil.kEightyFps")), (uiRes("m_workingTimeUtil.kNinetyFps")), (uiRes("m_workingTimeUtil.kHundredFps")), (uiRes("m_workingTimeUtil.kOneTwentyFps")), (uiRes("m_workingTimeUtil.kOneTwentyFiveFps")), (uiRes("m_workingTimeUtil.kOneFiftyFps")), (uiRes("m_workingTimeUtil.kTwoHundredFps")), (uiRes("m_workingTimeUtil.kTwoFortyFps")), (uiRes("m_workingTimeUtil.kTwoFiftyFps")), (uiRes("m_workingTimeUtil.kThreeHundredFps")), (uiRes("m_workingTimeUtil.kThreeSeventyFiveFps")), (uiRes("m_workingTimeUtil.kFourHundredFps")), (uiRes("m_workingTimeUtil.kFiveHundredFps")), (uiRes("m_workingTimeUtil.kSixHundredFps")), (uiRes("m_workingTimeUtil.kSevenFiftyFps")), (uiRes("m_workingTimeUtil.kTwelveHundredFps")), (uiRes("m_workingTimeUtil.kFifteenHundredFps")), (uiRes("m_workingTimeUtil.kTwoThousandFps")), (uiRes("m_workingTimeUtil.kThreeThousandFps")), (uiRes("m_workingTimeUtil.kSixThousandFps")), (uiRes("m_workingTimeUtil.kFourtyFourOneHundredFps")), (uiRes("m_workingTimeUtil.kFourtyEightThousandFps")) }; // // Add milliseconds, seconds, minutes, hours if you need them // int $hideNoFPSFramerateExists = `optionVar -exists hideNoFPSFramerate`; int $hideNoFPSFramerate = `optionVar -q hideNoFPSFramerate`; if($hideNoFPSFramerateExists == 1 && $hideNoFPSFramerate != 1) { int $size = size($timeUnitDisplayTable); $timeUnitDisplayTable[$size] = (uiRes("m_workingTimeUtil.kMilliSeconds")); $timeUnitDisplayTable[$size+1] = (uiRes("m_workingTimeUtil.kSecondsItem")); $timeUnitDisplayTable[$size+2] = (uiRes("m_workingTimeUtil.kMinutes")); $timeUnitDisplayTable[$size+3] = (uiRes("m_workingTimeUtil.kHours")); } return $timeUnitDisplayTable; } // // Return the number unit time to display // global proc int getTimeUnitDisplayStringCount() { string $timeUnitDisplayTable[] = getTimeUnitDisplayStringTable(); return size($timeUnitDisplayTable); } // // This function return the display string of specific time unit. // $index is a valid index in the gTimeUnitDisplayTable array. // global proc string getTimeUnitDisplayString(int $index) { string $gTimeUnitDisplayTable[] = getTimeUnitDisplayStringTable(); if($index < 0 || $index > size($gTimeUnitDisplayTable) ) error ( (uiRes("m_workingTimeUtil.kInvalidvalue")) + $index); return $gTimeUnitDisplayTable[$index]; } // // return a valid value to be use by the command "currentUnit -t" // $index is a value in range of 1 and size($gCurrentTimeCmdValueTable). // This function is use by drop down list and the value of those list start at 1. // global proc string getCurrentUnitCmdValue(int $index) { global string $gCurrentTimeCmdValueTable[]; if($index < 1 && $index > size($gCurrentTimeCmdValueTable) ) error ( (uiRes("m_workingTimeUtil.kInvalidvalue2")) + $index); return $gCurrentTimeCmdValueTable[$index-1]; } // // return the index of a valid value that can be use by "currentUnit -t" // The returned index start at one. // global proc int getIndexFromCurrentUnitCmdValue(string $timeUnit) { global string $gCurrentTimeCmdValueTable[]; int $index = stringArrayFind($timeUnit, 0, $gCurrentTimeCmdValueTable); if($index == -1) error ( (uiRes("m_workingTimeUtil.kInvalidvalue3")) + $timeUnit); return $index+1; }