浏览代码

switched to scheduled capture

/addressables-test/scheduledcapture
Mohsen Kamalzadeh 4 年前
当前提交
15d578d5
共有 2 个文件被更改,包括 12 次插入11 次删除
  1. 3
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  2. 20
      com.unity.perception/Runtime/Randomization/Scenarios/FixedLengthScenario.cs

3
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


using Unity.Simulation;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Perception.Randomization.Scenarios;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
#if HDRP_PRESENT

void OnBeginCameraRendering(ScriptableRenderContext scriptableRenderContext, Camera cam)
{
if (!ShouldCallLabelers(cam, m_LastFrameCaptured))
if (!ShouldCallLabelers(cam, m_LastFrameCaptured) || ScenarioBase.activeScenario.state != ScenarioBase.State.Playing)
return;
m_LastFrameCaptured = Time.frameCount;

20
com.unity.perception/Runtime/Randomization/Scenarios/FixedLengthScenario.cs


{
base.OnAwake();
m_PerceptionCamera = FindObjectOfType<PerceptionCamera>();
if (m_PerceptionCamera != null && m_PerceptionCamera.captureTriggerMode != CaptureTriggerMode.Manual)
{
Debug.LogError("The perception camera must be set to manual capture mode", m_PerceptionCamera);
m_PerceptionCamera.enabled = false;
enabled = false;
}
// if (m_PerceptionCamera != null && m_PerceptionCamera.captureTriggerMode != CaptureTriggerMode.Manual)
// {
// Debug.LogError("The perception camera must be set to manual capture mode", m_PerceptionCamera);
// m_PerceptionCamera.enabled = false;
// enabled = false;
// }
if (m_PerceptionCamera && currentIterationFrame == constants.framesPerIteration - 1)
{
m_PerceptionCamera.RequestCapture();
}
// if (m_PerceptionCamera && currentIterationFrame == constants.framesPerIteration - 1)
// {
// m_PerceptionCamera.RequestCapture();
// }
}
}
}
正在加载...
取消
保存