Camera settings: app.activeViewport.camera = ... not working

Camera settings: app.activeViewport.camera = ... not working

dunderhead
Advocate Advocate
554 Views
1 Reply
Message 1 of 2

Camera settings: app.activeViewport.camera = ... not working

dunderhead
Advocate
Advocate

I thought this little trick would change my focal length (in Model environment) so that the angle of view becomes 90 degrees (I swear I had this working many months ago), but luck escapes me today when I fire the one liner  (here formatted for clarity) into the TEXT COMMANDS window:

 

   app = adsk.core.Application.get();

   view = app.activeViewport;

   camera = view.camera;

   camera.perspectiveAngle = 3.14/180 * 90;

   view.camera = camera

 

Nothing happens. Also, the value app.activeViewport.camera doesn't change but remains at .about 0.39 radians. Am I missing something?

 

thx

 

 

0 Likes
Accepted solutions (1)
555 Views
1 Reply
Reply (1)
Message 2 of 2

frankzhang
Alumni
Alumni
Accepted solution

 

Please check if your camera settings is perspective or not, if it is not perspective, the change won't take effective. Check out below image for reference.

 

Camera settings.png