|
|
|
|
|
|
EditorUtility.CopySerialized(cameraData, m_PreviewAdditionalCameraData); |
|
|
|
var layer = c.GetComponent<PostProcessLayer>() ?? ComponentSingleton<PostProcessLayer>.instance; |
|
|
|
EditorUtility.CopySerialized(layer, m_PreviewPostProcessLayer); |
|
|
|
m_PreviewCamera.cameraType = CameraType.SceneView; // This is required else if we use Preview the image is flipped... (Unity...)
|
|
|
|
|
|
|
|
// We need to call UpdateDirtyFrameSettings to update the dirty flags that was set in the CopySerialized call
|
|
|
|
m_PreviewAdditionalCameraData.UpdateDirtyFrameSettings(true, cameraData.GetFrameSettings()); |
|
|
|
// And then to copy the runtime frame settings
|
|
|
|
// So this includes the runtime frame settings properly
|
|
|
|
cameraData.GetFrameSettings().CopyTo(m_PreviewAdditionalCameraData.GetFrameSettings()); |
|
|
|
m_PreviewHDCamera.Update(m_PreviewAdditionalCameraData.GetFrameSettings(), m_PreviewPostProcessLayer, null); |
|
|
|
m_PreviewCamera.cameraType = CameraType.Preview; |
|
|
|
|
|
|
|
var previewTexture = GetPreviewTextureWithSize((int)previewSize.x, (int)previewSize.y); |
|
|
|
m_PreviewCamera.targetTexture = previewTexture; |
|
|
|