Browse Source

auto exit render texture added

main
Cailean Finn 9 months ago
parent
commit
f5bfd56859
  1. 1
      Assets/6_Scenes/Beep.unity
  2. 13
      Assets/7_Scripts/Recording/RenderText.cs
  3. 2
      Assets/ML-Agents/Timers/Beep_timers.json

1
Assets/6_Scenes/Beep.unity

@ -17905,6 +17905,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7f6f2722d84da164ba3be22a8cd14381, type: 3} m_Script: {fileID: 11500000, guid: 7f6f2722d84da164ba3be22a8cd14381, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_NumberOfSecondsToRecord: 2
m_CaptureFrameRate: 30 m_CaptureFrameRate: 30
m_YHeight: -25 m_YHeight: -25
outputDirectory: SampleRecordings/Projection outputDirectory: SampleRecordings/Projection

13
Assets/7_Scripts/Recording/RenderText.cs

@ -10,6 +10,7 @@ using UnityEngine.UI;
public class RenderText : MonoBehaviour public class RenderText : MonoBehaviour
{ {
int frame = 60; int frame = 60;
public int m_NumberOfSecondsToRecord;
public int m_CaptureFrameRate; public int m_CaptureFrameRate;
public float m_YHeight = 0; public float m_YHeight = 0;
public string outputDirectory = "SampleRecordings/Projection"; public string outputDirectory = "SampleRecordings/Projection";
@ -70,6 +71,11 @@ public class RenderText : MonoBehaviour
private void Update() private void Update()
{ {
frame++;
if (frame > m_NumberOfSecondsToRecord * m_CaptureFrameRate)
EditorApplication.ExitPlaymode();
ToggleRecording(); ToggleRecording();
if (m_Record) if (m_Record)
@ -86,8 +92,6 @@ public class RenderText : MonoBehaviour
{ {
m_RecordedFrames = 0; m_RecordedFrames = 0;
} }
frame++;
} }
void SetMaterialParametersBasedOnProjectionType(int frameCount) void SetMaterialParametersBasedOnProjectionType(int frameCount)
@ -322,4 +326,9 @@ public class RenderText : MonoBehaviour
m_Record = false; m_Record = false;
} }
} }
private void OnApplicationQuit()
{
m_Record = false;
}
} }

2
Assets/ML-Agents/Timers/Beep_timers.json

@ -1 +1 @@
{"count":1,"self":225.4721792,"total":225.53041919999998,"children":{"InitializeActuators":{"count":1,"self":0.0020014,"total":0.0020014,"children":null},"InitializeSensors":{"count":1,"self":0.0030196999999999997,"total":0.0030196999999999997,"children":null},"AgentSendState":{"count":16,"self":0,"total":0.00050309999999999992,"children":{"CollectObservations":{"count":4,"self":0.00050309999999999992,"total":0.00050309999999999992,"children":null},"WriteActionMask":{"count":4,"self":0,"total":0,"children":null},"RequestDecision":{"count":4,"self":0,"total":0,"children":null}}},"DecideAction":{"count":16,"self":0.0501965,"total":0.0501965,"children":{"RayPerceptionSensor.Perceive":{"count":4,"self":0,"total":0,"children":null}}},"AgentAct":{"count":16,"self":0.0025109,"total":0.0025109,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1712844888","unity_version":"2023.2.8f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2023.2.8f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_3-Beep\\beep-final -useHub -hubIPC -cloudEnvironment production","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.3.0-exp.3","scene_name":"Beep","end_time_seconds":"1712845113"}} {"count":1,"self":89.913727999999992,"total":90.0057209,"children":{"InitializeActuators":{"count":1,"self":0.0015137999999999998,"total":0.0015137999999999998,"children":null},"InitializeSensors":{"count":1,"self":0.0025104999999999997,"total":0.0025104999999999997,"children":null},"AgentSendState":{"count":102,"self":0,"total":0.0015044,"children":{"CollectObservations":{"count":21,"self":0,"total":0,"children":null},"WriteActionMask":{"count":21,"self":0.0015044,"total":0.0015044,"children":null},"RequestDecision":{"count":21,"self":0,"total":0,"children":null}}},"DecideAction":{"count":102,"self":0.0829095,"total":0.0829095,"children":{"RayPerceptionSensor.Perceive":{"count":21,"self":0,"total":0,"children":null}}},"AgentAct":{"count":102,"self":0.0035551999999999997,"total":0.0035551999999999997,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1712914650","unity_version":"2023.2.8f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2023.2.8f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_03-Beep\\beep-final -useHub -hubIPC -cloudEnvironment production","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.3.0-exp.3","scene_name":"Beep","end_time_seconds":"1712914740"}}
Loading…
Cancel
Save