static void UpdateAbcCamera(aiObject abc, Transform trans) { var cam = trans.GetComponent <Camera>(); if (cam == null) { cam = trans.gameObject.AddComponent <Camera>(); } aiCameraParams cp = default(aiCameraParams); aiCameraGetParams(abc, ref cp); cam.fieldOfView = cp.field_of_view; cam.nearClipPlane = cp.near_clipping_plane; cam.farClipPlane = cp.far_clipping_plane; /* * var dof = trans.GetComponent<UnityStandardAssets.ImageEffects.DepthOfField>(); * if(dof != null) * { * dof.focalLength = cp.focus_distance; * dof.focalSize = cp.focal_length; * } */ }
[DllImport("AlembicImporter")] public static extern void aiCameraGetParams(aiObject obj, ref aiCameraParams o_params);