He guys and Dev Team,
I wrote this quick little script to add a stereoscopic helper to a scene and link it to a camera somewhat logically. It parents it to the camera and links up the eye distance and focus distance parameters to the camera. This makes managing camera selection and keying easier by default. Make a camera selection and run the following code to try it out. Improvements welcome. I think there should ultimately just be a simple stereoscopic roll-out on the physical camera, where all the stereoscopic parameters can just reside and the helper isn't needed. I presume it is separated because of some weird max back-end stuff.
Here's the code:
I found this helpful and wanted to share.
I wrote this quick little script to add a stereoscopic helper to a scene and link it to a camera somewhat logically. It parents it to the camera and links up the eye distance and focus distance parameters to the camera. This makes managing camera selection and keying easier by default. Make a camera selection and run the following code to try it out. Improvements welcome. I think there should ultimately just be a simple stereoscopic roll-out on the physical camera, where all the stereoscopic parameters can just reside and the helper isn't needed. I presume it is separated because of some weird max back-end stuff.
Here's the code:
Code:
selectedItemsArray = selection as array for i in selectedItemsArray do ( if (SuperclassOf i == camera)then ( print ("Camera Found.... proceeding to add a node to "+ i.name +" and link some parameters.") --Create Stereo Node VRayStereoscopic isSelected:on $.parent = i in coordsys parent $.pos = [5,0,0] $.rotation.controller = SlaveRotation () $.name = i.name+"_stereoNode" theStereoNodeName = $.name $.interocular_method = 2 $.focus_method = 0 $.show_camera_cones = 1 the_stereoData = attributes stereoData ( parameters main rollout:stereoParams ( StereoEyeDistance type:#float Align:#Center ui:StereoEyeDistanceSpinner default:6.5 Range:[-100,100,6.5] ) rollout stereoParams "StereoParameters" ( spinner StereoEyeDistanceSpinner "StereoEyeDistance" type: #float ) ) custAttributes.add i the_stereoData paramWire.connect2way i.baseObject[#specify_focus] $.baseObject[#specify_focus] "specify_focus" "specify_focus" paramWire.connect2way i.baseObject[#focus_distance] $.baseObject[#focus_distance] "focus_distance" "focus_distance" paramWire.connect2way i.baseObject.stereoData[#StereoEyeDistance] $.baseObject[#eye_distance] "eye_distance" "StereoEyeDistance" )else (print "No cameras in selection!") )
Comment