Change zoom of all cameras at once
-
Hi... Long time no post.
I've been browsing the plugins index but I still can't find one that can change the zoom of all cameras in the model at once. For example, from 45 degrees to 60 degrees.
The reason I want to automatize this process is that I have 6 files with around 90 cameras each.
-
By camera, I assume you mean scenes with camera location saved in that scene, right? Bot some other type of camera data (from another plugin or something?).
Run this line of code from the Ruby Console and it will adjust all cameras to a specified FOV. WARNING, there is no easy undo on this.
m=Sketchup.active_model;v=m.active_view;m.pages.each{|e| cam=e.camera;cam.fov=60;v.camera=cam}
That is all one line, just paste it and hit enter. It will reset all camera's to 60's, though it might trip and cancel on non-perspective cameras. I should go test that.
In the line of code, it says fov=60. Change the 60 to whatever you want it to be. 60 was what you had given as an example, but you can put it at any FOV.
Chris
-
ok, it looks like it just gives a quick warning about non perspective cameras, but does not cancel. So it should work,
Chris
-
Thank you a lot, Chris. Worked perfectly. All my cameras (actually, scenes as you pointed out) are perspective ones, so I received no warnings.
No worries about not being able to undo... I save a new file version several times a day.
Advertisement