EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.captureRgbImages)),newGUIContent("Save Camera Output to Disk","For each captured frame, save an RGB image of the perception camera's output to disk."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.captureTriggerMode)),newGUIContent("Capture Trigger Mode",$"The method of triggering captures for this camera. In {nameof(PerceptionCamera.CaptureTriggerMode.Scheduled)} mode, captures happen automatically based on a start time/frame and time/frame interval. In {nameof(PerceptionCamera.CaptureTriggerMode.Manual)} mode, captures should be triggered manually through calling the {nameof(perceptionCamera.CaptureOnNextUpdate)} method of {nameof(PerceptionCamera)}."));
GUILayout.BeginVertical("Box");
GUILayout.BeginVertical("TextArea");
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.startTime)),newGUIContent("Start Time","Time at which this perception camera starts rendering and capturing (seconds)."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.period)),newGUIContent("Capture Interval","The interval at which the perception camera should render and capture (seconds)."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.onlyRenderCapturedFrames)),newGUIContent(onlyRenderCaptTitle,$"If this checkbox is enabled, the attached camera will only render those frames that it needs to capture. In addition, the global frame delta time will be altered to match this camera's capture period, thus, the scene will not be visually updated in-between captures (physics simulation is unaffected). Therefore, if you have more than one {nameof(PerceptionCamera)} active, this flag should be either disabled or enabled for all of them, otherwise the cameras will not capture and synchronize properly."));
if(perceptionCamera.onlyRenderCapturedFrames)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.startTime)),newGUIContent("Start Time","Time at which this perception camera starts rendering and capturing (seconds)."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.period)),newGUIContent(periodTilte,"The interval at which the perception camera should render and capture (seconds)."));
EditorGUILayout.HelpBox($"First capture at {perceptionCamera.startTime} seconds and consecutive captures every {perceptionCamera.period} seconds",MessageType.None);
}
else
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.renderingDeltaTime)),newGUIContent(frametimeTitle,"The rendering frame time (seconds). E.g. 0.0166 translates to 60 frames per second."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.startFrame)),newGUIContent("Start at Frame",$"Frame number at which this camera starts capturing."));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.framesBetweenCaptures)),newGUIContent("Frames between captures","The number of frames to render between the camera's scheduled captures. Setting this to 0 makes the camera capture every rendered frame."));
//Because start time only needs to be calculated once, we can do it here. But for scheduling consecutive captures,
//we calculate the time of the next capture every time based on the values given for captureEveryXFrames and renderingDeltaTime, in order to preserve accuracy.
EditorGUILayout.HelpBox($"Captures should be triggered manually through calling the {nameof(perceptionCamera.CaptureOnNextUpdate)} method of {nameof(PerceptionCamera)}",MessageType.None);
/// <returns>A <see cref="SensorHandle"/>, which should be used to check <see cref="SensorHandle.ShouldCaptureThisFrame"/> each frame to determine whether to capture (or render) that frame.
/// It is also used to report captures, annotations, and metrics on the sensor.</returns>
/// <exception cref="ArgumentException">Thrown if ego is invalid.</exception>
/// Frame number at which this camera starts capturing.
/// </summary>
publicintstartFrame;
/// <summary>
/// The method of triggering captures for this camera. In <see cref="PerceptionCamera.CaptureTriggerMode.Scheduled"/> mode, captures happen automatically based on a start time/frame and time/frame interval. In <see cref="PerceptionCamera.CaptureTriggerMode.Scheduled"/> mode, captures should be triggered manually through calling the <see cref="PerceptionCamera.CaptureOnNextUpdate"/> method of <see cref="PerceptionCamera"/>."
/// When enabled, the camera will only render those frames that it needs to capture. In addition, the global frame delta time (<see cref="Time.captureDeltaTime"/>) will be altered to match this camera's capture period, thus, the scene will not be visually updated in-between captures (physics simulation is unaffected). If there is more than one <see cref="PerceptionCamera"/> active, this flag should be either disabled or enabled for all of them, otherwise the cameras will not capture and synchronize properly.
/// </summary>
publicboolonlyRenderCapturedFrames=true;
/// <summary>
/// The rendering frame time (seconds). E.g. 0.0166 translates to 60 frames per second.
/// </summary>
/// <summary>
/// "The number of frames to render between the camera's scheduled captures when the rendering delta time is not controlled by this camera (i.e. <see cref="onlyRenderCapturedFrames"/> is false). Setting this to 0 makes the camera capture every rendered frame.
/// </summary>
publicintframesBetweenCaptures=0;
/// <summary>
/// Requests a capture from this camera on the next rendered frame. Can only be used when using <see cref="PerceptionCamera.CaptureTriggerMode.Manual"/> capture mode.
//In this case, the simulation timing is controlled by this and other sensors that have this flag enabled, so we can precisely jump to the next frame using a specific delta (capture period) provided by the user