Home Technical Talk

Default Maya Orthographic Camera Position/Clipping Planes

polycounter lvl 4
Offline / Send Message
Old Wither polycounter lvl 4
When I create a new scene in Maya, my perspective camera works fine but my ortho cams are unusable without tweaking. They're set to 1000.1 units from origin, and near clip/far clip is set to 0.001/100.

I can set default perspective cam options in create>camera>options, but that doesn't seem to apply to ortho cams. I can also set default clipping planes in settings>cameras, but I have that set to .1/10000 so I'm guessing that's perspective cams as well.

Any suggestions?

Replies

  • throttlekitty
    Options
    Offline / Send Message
    You could create a shelf button to set the default camera attributes that you can use manually. Or use a usersetup.mel with a scriptJob to do it automatically, something like:

    string $doCameraStuff  = "do camera stuff here";
    scriptJob -e "NewSceneOpened" $doCameraStuff;
  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    A third option is to fix it manually, save as a file, set it as a default file to use when you got File->New
  • Old Wither
    Options
    Offline / Send Message
    Old Wither polycounter lvl 4
    Ended up doing a combo of both of the above responses. Using a default scene didn't work; for some reason the cameras were always set to the default even though I'd edited them in the saved scene.

    I don't think usersetup.mel runs when you open a scene, just when you load Maya, so I created a default scene with a script node that runs the following script on load:

    select -r persp ;
    setAttr "perspShape.nearClipPlane" 0.1;
    setAttr "perspShape.farClipPlane" 1000;
    
    select -r top ;
    setAttr "top.translateY" 100;
    setAttr "topShape.nearClipPlane" 0.1;
    setAttr "topShape.farClipPlane" 1000;
    
    select -r front ;
    setAttr "front.translateZ" 100;
    setAttr "frontShape.nearClipPlane" 0.1;
    setAttr "frontShape.farClipPlane" 1000;
    
    select -r side ;
    setAttr "side.translateX" 100;
    setAttr "sideShape.nearClipPlane" 0.1;
    setAttr "sideShape.farClipPlane" 1000;
    
    select -r persp top front side ;
    doHideInOutliner 1;
    This sets camera positions/clipping planes to appropriate values if you're using meters as your working unit, and then hides them in the outliner (personal preference). Thanks for the responses.
  • throttlekitty
    Options
    Offline / Send Message
    I'm 99% sure that setting a scriptJob in usersetup sticks as a global script for the entire session and doesn't get attached to the first scene in the session. I'll have to revisit that at some point. Cool that works for you though. :)
Sign In or Register to comment.