Frame Playback Range

Frame Playback Range

dg3duy
Collaborator Collaborator
319 Views
2 Replies
Message 1 of 3

Frame Playback Range

dg3duy
Collaborator
Collaborator

I can't believe that this option is not enabled by default in the graph editor.
An alternative plan is to make a scriptjob but it is not viable because I don't have the knowledge to stop flickering when doing Fit.
Any suggestions on how to make it not update the graph editor when doing fit and then update it?

Frame/Frame Playback Range
dg3duy_0-1660517648100.png

graph.gif

 

global proc setAutoFrame()
	{

	animCurveEditor -edit -autoFit 1 graphEditor1GraphEd;
	optionVar -intValue graphEditorAutoFit 1;
	animView -startTime (`playbackOptions -query -minTime` - 1) -endTime (`playbackOptions -query -maxTime` + 1) graphEditor1GraphEd;
	
	}
scriptJob -event graphEditorParamCurveSelected setAutoFrame;

 

0 Likes
Accepted solutions (1)
320 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor

Hi!

 

Line 5 of your code is obsolete, you are using autofit twice, once via the command and the other time by using the UI via code.

You can simply add the -aft flag as 0 to you animCurveEditor command and stop it form fitting time, since you are overwriting time at the end of the script anyways, that way if you don't zoom in or out there won't be a flicker since the displayed timerange doesn't change.

 

But I'm not sure why you would want this feature. It literally stops you from zooming in on a section in the grapheditor and tweeking details in your curves without getting zoomed out everytime you select/deselect a keyframe/tangent. If this was toggled on by default, animators would lose their minds and stop using Maya...

Message 3 of 3

dg3duy
Collaborator
Collaborator
Accepted solution

@Kahylan 
I show you the final result of what I was looking for, here I share it with everyone.
Update the graph editor if the curve exceeds the limits.
Activated the curves in absolute view.

global proc setAutoFrame()
	{
toggleAutoLoad graphEditor1OutlineEd 0;
int $fit = `optionVar -q graphEditorAutoFit`;
if ($fit==0){
    optionVar -intValue graphEditorAutoFit 1;
        
	}
{ 
         
if ($fit==0){
    optionVar -intValue graphEditorAutoFit 1;
	}
	doReload graphEditor1OutlineEd;
    toggleAutoLoad graphEditor1OutlineEd 0;
}	
	
	}
scriptJob -event graphEditorChanged setAutoFrame;
//scriptJob -ka -f;

graph fit.gif

0 Likes