Perspective Camera View goes crazy

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  11 November 2014
Perspective Camera View goes crazy

Hello guys,

I have a problem.

My Perspective view goes really crazy.
By clicking to a vertex. My model disappear from the perspective camera and my mesh goes deformed.
In the other views the mes still in the same position (I can see the model) but deformed.

I I do a selection on the other orthogonal cameras works everything fine.

I also tried these and nothing happens....


setAttr "persp.translateX" 100;
setAttr "persp.translateY" 0;
setAttr "persp.translateZ" 0;
setAttr "persp.rotateX" 0;
setAttr "persp.rotateY" 90;
setAttr "persp.rotateZ" 0;
setAttr "persp.scaleX" 1;
setAttr "persp.scaleY" 1;
setAttr "persp.scaleZ" 1;
setAttr "persp.visibility" on;

setAttr "perspShape.centerOfInterest" 44.822;
setAttr "perspShape.orthographicWidth" 10;
setAttr "perspShape.orthographic" 0;


setAttr "perspShape.focalLength" 54.43;
setAttr "perspShape.focalLength" 80;

setAttr "persp.translateX" 28;
setAttr "persp.translateY" 21;
setAttr "persp.translateZ" 28;
setAttr "persp.rotateX" -27.938;
setAttr "persp.rotateY" 45;


viewSet -home top;
viewSet -home front;
viewSet -home side;
viewSet -home persp;


I tried also View/Predefined Bookmarks/Perspective.
And nothing helps.

Is there a way to reset the Camera?
I will appreciate any information.
Is really frustrating having a no working camera. I mean I can create a new one, but why to do that when should also possible to reset the camera, right?...
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
  11 November 2014
We have this behaviour sometimes, e.g. if I do a frame selection, the camera goes into nirvana and shows NAN in translate values. Even if I reset my camera into the origin, it doesn't help. So my advice is to import your scene into an empty maya scene.
__________________
www.renderwiki.com - www.openmaya.net
 
  11 November 2014
Hello haggi!!

Thank you for your reply.
I actually solve the problem copying everything from the Outliner into another new scene.
I a quick and dirty solution.


BUT

I never thought about to import the old scene into a new one.
Great Idea... I will try it now.

I just wanted to keep the old scene and try to rapair the camera, but as you said...
There is no way.
I did everything (guess so), but nothing works.

Once again... Thank you for the great idea!!
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
  11 November 2014
Hi haggi,

The import Idea was PERFECT!!

Now just only one issue...

Oh boy!!!
Now the problem is to rename every layer and object in the scene
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
  11 November 2014
You dont need to screw around importing stuff into other scenes...that could probably break other stuff...

Best way to fix a currupt camera is to remake it.

In python script editor:




import maya.cmds as cmds

def fixThePerspCamera():
 	perCam = 'persp'
 	cmds.camera(perCam,e=True,sc=False)
 	cmds.delete(perCam)
 	newCam = cmds.camera()
 	cmds.rename(newCam[0] ,'persp')
 	cmds.camera('persp',e=True,sc=True)
 	
 fixThePerspCamera() 



Basically all it does is unlock the persp camera from being un-deletable(cause its a default scene camera), deletes it, then makes a new camera and renames it to 'persp' then locks it back to a default scene camera again..
__________________
 
  11 November 2014
that should be:




import maya.cmds as cmds

def fixThePerspCamera():
	perCam = 'persp'
	cmds.camera(perCam,e=True,sc=False)
	cmds.delete(perCam)
	newCam = cmds.camera()
	cmds.rename(newCam[0] ,'persp')
	cmds.camera('persp',e=True,sc=True)
	
fixThePerspCamera()	



these forums screw up the white space in code sometimes its it sucks to fix it...so I just repost
__________________
 
  11 November 2014
Hey Cyberone,

Thank you for your help and time.

I tired really hard not to go to easy way. Dont like to be like that.
This time I couldnt solve the problem

Deleting the Camera and renaming it is an easy way, but why the cameras goes crazy.
Which move, mouse click or other is cousin that the camera really goes to the nirvana like haggi already said.
And why is not reparable?

Until I can find a solution I will use for sure your suggestions an script.
I think you script is really useful that I will add with credits of course to my scripts... If you allow me.

Thank you in advance and cheers!
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
  11 November 2014
Originally Posted by 2xbo: ...is cousin that the camera really goes to the nirvana like haggi...


Quote of the day right there!
__________________
..je suis -L -S -D!
 
  11 November 2014
Sometimes I've had to save out to .MA and edit out NANs directly (in a text editor), since things tend to break badly when they appear.
 
  12 December 2014
Originally Posted by coccosoids: Quote of the day right there!

No coccosoids. I didnt said that haggi goes creazy!!
LOL!!≥


Originally Posted by gfk: Sometimes I've had to save out to .MA and edit out NANs directly (in a text editor), since things tend to break badly when they appear.

That is really sucks.
This is the first time that I have this Problem without solution.
I had before and I could solve it, but now this kind of behavior doesnt have a solution anymore.
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
  01 January 2016
Originally Posted by Cyberone: that should be:




import maya.cmds as cmds

def fixThePerspCamera():
	perCam = 'persp'
	cmds.camera(perCam,e=True,sc=False)
	cmds.delete(perCam)
	newCam = cmds.camera()
	cmds.rename(newCam[0] ,'persp')
	cmds.camera('persp',e=True,sc=True)
	
fixThePerspCamera()	



these forums screw up the white space in code sometimes its it sucks to fix it...so I just repost


Thanks a mill, Simon and happy new year 2016.
 
  02 February 2018
Sorry to resurrect a dead topic, but I've been having a similar problem with the perspective camera. I can fix it by typing values into the "NaN" fields in the channel box, but then when I go to focus my view on a particular control (I'm trying to animate), the camera will go crazy again. And I kind of -need- to focus my camera every 30 seconds or so...†

I finally found a fix that seems to work though. Go into Preferences -> Settings -> Camera and drag the "Near clip" and "Far clip" values inward. (I set mine to 110.639 and 8127.660 at random.) Then close Maya and re-open the scene. Focusing should now work and not mess up the camera!

Again, sorry to resurrect a dead topic here. Writing this for others' benefit, as well as my own (bookmarking this thread). This is the second time in a few months this has happened to me, and it's a PITA to be taken out of my work.

Cheers!

Last edited by jordanjs : 02 February 2018 at 12:33 AM. Reason: OCD, noticed grammar errors
 
  02 February 2018
I run into this NAN camera silliness once in awhile as well, but it's always readily fixable in Maya 2015 by resetting the perspectiveCamera back to its defaults (Alt+Home). For me the problem usually starts when trying to MMB-snap objects in a scene. I used to export/reimport but then you lose your camera bookmarks of course, and it's all unnecessary.
__________________
Commodore 64 @ 1MHz
64KB RAM
1541 Floppy Drive


"Like stone we battle the wind... Beat down and strangle the rains..."
 
  02 February 2018
(There's nothing wrong with replying to an old topic, as long as you know you're doing it.† Did the forum stop locking old threads?† It made no sense at all, since it forced people to start new threads when it's much better to add information to an existing thread on the subject, no matter how old it is.† That way, when people search for information later, all the information is in one place instead of being scattered in a bunch of disconnected threads.)

The default clipping planes should only affect new scenes, since the camera settings are saved with the scene, so it's weird if it's having an effect on existing scenes.† Also, if your near clipping plane was 110, you wouldn't be able to see anything closer than 1.1 meters from the camera, which you'd notice pretty quickly...

I've never seen the camera position break when focusing an object.† Can you isolate the problem into something you could post?† What type of node is the control?† I think focusing an object only uses the object's bounding box in world space--I could see it having bad results if the bbox was corrupt, but I've never seen that happen.
 
  02 February 2018
Hi gfk,

Nice to see you looking at this thread.
Im agree. It is better to keep all the information together rather than ask again and again the same question in a different threads from other users.
What I do must is - I look first if someone has the same problem and get informed and learn from their problem over their threads.
If that doesnt work for me or there is no information about my problem I open a new thread.

Back to the topic.
I need to look into the scene that had that problem and back to you again.
Lucky me I just had this ones and until now no anymore.
For a couple of weeks I had the same problem, but I could manage at that time.

But that old file was really bad.
Let me have a look if I can find the file.

Cheers!
__________________
~{xbo}~
| Car Designer | MaYa Modeller | 3D Nurbs-Poly Modeller | VRay for MaYa | Phoenix for MaYa


My Basics Mel Scripts
~{xbo_::_Scripts}~
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:12 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.