浏览代码

Logging the data output directory. Adding checks ensuring SimulationManager APIs are not called in edit mode. Attempting to fix image flip issues in Mac editor.

/main
Jon Hogins 5 年前
当前提交
9162b6cb
共有 5 个文件被更改,包括 22 次插入9 次删除
  1. 5
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  2. 11
      com.unity.perception/Runtime/GroundTruth/SimulationState.cs
  3. 1
      com.unity.perception/Runtime/GroundTruth/SimulationState_Json.cs
  4. 7
      com.unity.perception/LICENSE.md.meta
  5. 7
      com.unity.perception/LICENSE.meta

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


using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;

//Based on logic in HDRenderPipeline.PrepareFinalBlitParameters
return camera.targetTexture != null || hdAdditionalCameraData.flipYMode == HDAdditionalCameraData.FlipYMode.ForceFlipY || camera.cameraType == CameraType.Game;
#elif URP_PRESENT
return SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 && (camera.targetTexture != null || camera.cameraType == CameraType.Game);
return (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) &&
(camera.targetTexture != null || camera.cameraType == CameraType.Game);
#else
return false;
#endif

11
com.unity.perception/Runtime/GroundTruth/SimulationState.cs


public void AddEgo(EgoHandle egoHandle)
{
CheckDatasetAllowed();
public bool IsEnabled(SensorHandle sensorHandle) => m_ActiveSensors.Contains(sensorHandle);

m_ActiveSensors.Remove(sensorHandle);
else
m_ActiveSensors.Add(sensorHandle);
}
void CheckDatasetAllowed()
{
if (!Application.isPlaying)
{
throw new NotSupportedException("Dataset generation is only supported in play mode.");
}
}
public void Update()

void RegisterAdditionalInfoType<TSpec>(string name, TSpec[] specValues, string description, string format, Guid id, AdditionalInfoKind additionalInfoKind)
{
CheckDatasetAllowed();
var annotationDefinitionInfo = new AdditionalInfoTypeData()
{
additionalInfoKind = additionalInfoKind,

1
com.unity.perception/Runtime/GroundTruth/SimulationState_Json.cs


WriteJObjectToFile(metricDefinitionsJObject, "metric_definitions.json");
}
}
Debug.Log($"Dataset written to {OutputDirectory}");
}
void WriteJObjectToFile(JObject jObject, string filename)

7
com.unity.perception/LICENSE.md.meta


fileFormatVersion: 2
guid: 4396a357bb154764ba0cbeb2e508fba9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
com.unity.perception/LICENSE.meta


fileFormatVersion: 2
guid: 1011799e246cfca4085ea04ca29c9ab0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存