Fix camera preview in scene animation

This commit is contained in:
Wojtek Figat
2021-08-04 17:35:42 +02:00
parent 080b3b1136
commit 980aa860fc

View File

@@ -107,6 +107,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
float orthoScale = 1.0f; float orthoScale = 1.0f;
float fov = 60.0f; float fov = 60.0f;
float customAspectRatio = 0.0f; float customAspectRatio = 0.0f;
view.RenderLayersMask = new LayersMask(uint.MaxValue);
// Try to evaluate camera properties based on the initial camera state // Try to evaluate camera properties based on the initial camera state
if (cam) if (cam)
@@ -119,6 +120,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
orthoScale = cam.OrthographicScale; orthoScale = cam.OrthographicScale;
fov = cam.FieldOfView; fov = cam.FieldOfView;
customAspectRatio = cam.CustomAspectRatio; customAspectRatio = cam.CustomAspectRatio;
view.RenderLayersMask = cam.RenderLayersMask;
} }
// Try to evaluate camera properties based on the animated tracks // Try to evaluate camera properties based on the animated tracks
@@ -176,7 +178,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
view.NonJitteredProjection = view.Projection; view.NonJitteredProjection = view.Projection;
view.TemporalAAJitter = Vector4.Zero; view.TemporalAAJitter = Vector4.Zero;
view.ModelLODDistanceFactor = 100.0f; view.ModelLODDistanceFactor = 100.0f;
view.Flags = ViewFlags.DefaultGame & ~(ViewFlags.MotionBlur | ViewFlags.EyeAdaptation); view.Flags = ViewFlags.DefaultGame & ~(ViewFlags.MotionBlur);
view.UpdateCachedData(); view.UpdateCachedData();
task.View = view; task.View = view;
} }