Is it possible to make a script to chnage the Vray settings? I want to set the camera mode to spherical and the FOV to 180

I want to have two scripts saved to the toolbar just so I can quickly toggle between using normal camera and spherical camera mode as I need to render both quite often.

The maxscript listener doesn’t pick up any changes to the vray settings.

This will set it to a 180 degree spherical camera:

vr=renderers.current
vr.camera_type=1
vr.camera_fov=180
vr.camera_overrideFOV=1

To set it back to normal:

vr=renderers.current
vr.camera_type=8
vr.camera_overrideFOV=0

The “8” above for camera type is a perspective camera. I can’t seem ​set it back to “default” (setting it to 0 had no change).​

Here’s a script that will toggle from one to the other… (I’m getting a 403 error when I try to paste it so I’ll just attach it.)
CamToggle.zip (237 Bytes)

Hey mate, thanks for that, but I am gettign this error:

-- Unknown property: “camera_type” in V_Ray_GPU_6__update_2:V_Ray_GPU_6__update_2
-- MAXScript callstack:
-- thread data: threadID:3752
-- ------------------------------------------------------
-- [stack level: 0]
-- In top-level
-- Unknown property: “camera_overrideFOV” in V_Ray_GPU_6__update_2:V_Ray_GPU_6__update_2
-- MAXScript callstack:
-- thread data: threadID:3752
-- ------------------------------------------------------
-- [stack level: 0]
-- In top-level​

I guess Vray GPU is different?

No problem. For GPU, the camera settings lie in the “.V_Ray_settings” that gets transferred between CPU and GPU if you switch between them. This makes the syntax a little different. Also, GPU only has a “Spherical Panorama” camera type not “Spherical” so I’m switching between them for CPU/GPU. Update attached.
CamToggle-Universal.zip (330 Bytes)

Thanks so much for this mate - sorry for lack of respect and reply, I have been super busy, and jumped off the project where I need this - so I haven’t had time to use your script which will, no doubt, save me from goign crazy when the time comes.