Created
October 9, 2015 13:36
-
-
Save Onefabis/0c061f1ed3e0cfa57c0a to your computer and use it in GitHub Desktop.
Frames all objects in active window inside maya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymel.core as pc | |
pann = pc.getPanel(wf=1) | |
if (pann == 'graphEditor1'): | |
fsfr = pc.findKeyframe(ts=1, w='first') | |
lsfr = pc.findKeyframe(ts=1, w='last') | |
graphEditorSelection = pc.selectionConnection('graphEditor1FromOutliner',q=1,obj=1) | |
pc.selectKey(clear=1) | |
pc.selectKey(graphEditorSelection,add=1,k=1,t=(str(fsfr) + ":" + str(lsfr))) | |
elif(pann == 'hyperGraphPanel1' or pann == 'hyperGraphPanel2'): | |
pc.hyperGraph(pann+'HyperGraphEd',e=1,fg=1) | |
elif(pann == 'hyperShadePanel1'): | |
mel.eval('hyperShadePanelMenuCommand("hyperShadePanel1", "frameAll");') | |
else: | |
pc.viewFit(all=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment