This script can improve objects, nodes and curves fitting (framing).
– Frame selected keys horizontally and vertically.
– If nothing is selected the script will frame all keys within active time range horizontally and vertically.
– In viewport, hypergraph and hypershade the script will frame selected, otherwise it will frame all.
In order to assign hotkey copy this part of the code and insert it into the Hotkey editor.
Copy this file in your maya scripts folder. For example – C:\Users\ ***Username*** \Documents\maya\2016-x64\scripts
Open Maya, open the script editor and in a python tab paste two lines below :
Select this line and with middle mouse click drag it to your shelf
Then assign the icon to the script via the shelf editor