Relative Frame displays the current frame number relative to the start of the time slider playback range.
Setup: Assign the following Python code to a shelf button:
import maya.cmds as cmds
def relativeFrame(*args):
startTime = cmds.playbackOptions(q = True, min = True)
time = cmds.currentTime(q = True) - startTime + 1
return time
if cmds.headsUpDisplay('HUDRelativeFrame', exists = True):
cmds.headsUpDisplay( 'HUDRelativeFrame', rem = True )
else:
nextBlock = cmds.headsUpDisplay( 'HUDRelativeFrame', nfb = 9)
cmds.headsUpDisplay( 'HUDRelativeFrame', section = 9, block = nextBlock, blockSize = 'medium', label = 'Relative Frame:', labelFontSize = 'large', dataFontSize = 'large', command = relativeFrame, atr = True)