标签:
呃...15年开篇~
去年想写一个有关默认相机转VR相机的脚本,当时没写完,今天不小心翻到并写完了,而且思路也和原来完全不一样了,增加了是否删除原相机与是否转换所选相机的选项.
由于国内VR版本比较混乱,中间加了个中英文版本的适配.
fn cam_to_vrcam sel:#off del:#on = ( local sel_cam = #() local del_cam = #() case sel of ( #off : cams = cameras #on : cams = sel_cam + selection ) case of ( (VRayPhysicalCamera != undefined) : YY_vrcam = VRayPhysicalCamera isSelected:on (VR物理摄影机 != undefined) : YY_vrcam = VR物理摄影机 isSelected:on (VR_物理摄影机 != undefined) : YY_vrcam = VR_物理摄影机 isSelected:on -- default: ) for c=1 to cams.count do ( if (classof cams[c] == Freecamera) or (classof cams[c] == Targetcamera) do ( YY_new_cam = copy YY_vrcam try cams[c].type = #free catch() YY_new_cam.rotation = cams[c].rotation YY_new_cam.pos = cams[c].pos append del_cam cams[c] ) ) delete YY_vrcam case del of ( #on : for d in del_cam do delete d #off : () ) )--将默认相机转化为VR物理相机 cam_to_vrcam sel:#on del:#on
找到更简单的方法再继续修改~
标签:
原文地址:http://www.cnblogs.com/3dxy/p/4222982.html