Fixing Maya’s camera focus

Sometimes Maya camera gets corrupted and when you try to focus on objects it just goes really far away and usually this behavior persists on all scenes you open from there on.

A quick way that has worked for me to fix it is to first close all open Maya sessions, then find your userPrefs.mel file and search for this line:

-fv "defaultFitFactor" 0

Just change the value to 1 and it should fix your issue.

If you don’t want to edit the file directly you can run the following MEL command inside Maya:

optionVar -fv "defaultFitFactor" 1;

Or the alternative Python command:

from maya import cmds
cmds.optionVar( fv=('defaultFitFactor', 1) )

When applying any of these fixes make sure there is only the current Maya session running or you might overwrite the fix by closing a Maya session that still has the old value set.

2 thoughts on “Fixing Maya’s camera focus

Leave a comment