浏览代码

Adding test variant which uses SkinnedMeshRenderer

/main
Jon Hogins 5 年前
当前提交
8128e162
共有 2 个文件被更改,包括 30 次插入19 次删除
  1. 34
      TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
  2. 15
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs

34
TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity


m_Component:
- component: {fileID: 1640252283}
- component: {fileID: 1640252282}
- component: {fileID: 1640252281}
- component: {fileID: 1640252280}
- component: {fileID: 1640252280}
m_Layer: 0
m_Name: Box
m_TagString: Untagged

m_EditorClassIdentifier:
labels:
- Box
--- !u!65 &1640252280
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1640252278}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1640252281
MeshRenderer:
--- !u!137 &1640252280
SkinnedMeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTracingMode: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
serializedVersion: 2
m_Quality: 0
m_UpdateWhenOffscreen: 0
m_SkinnedMotionVectors: 1
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
m_Bones: []
m_BlendShapeWeights: []
m_RootBone: {fileID: 0}
m_AABB:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.5, y: 0.5, z: 0.5}
m_DirtyAABB: 0
--- !u!33 &1640252282
MeshFilter:
m_ObjectHideFlags: 0

15
com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs


// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
public IEnumerator SegmentationPassTestsWithEnumeratorPasses()
public IEnumerator SegmentationPassTestsWithEnumeratorPasses([Values(false, true)] bool useSkinnedMeshRenderer)
{
int timesSegmentationImageReceived = 0;
int? frameStart = null;

//Put a plane in front of the camera
var planeObject = GameObject.CreatePrimitive(PrimitiveType.Plane);
if (useSkinnedMeshRenderer)
{
var oldObject = planeObject;
planeObject = new GameObject();
var meshFilter = oldObject.GetComponent<MeshFilter>();
var meshRenderer = oldObject.GetComponent<MeshRenderer>();
var skinnedMeshRenderer = planeObject.AddComponent<SkinnedMeshRenderer>();
skinnedMeshRenderer.sharedMesh = meshFilter.sharedMesh;
skinnedMeshRenderer.material = meshRenderer.material;
Object.DestroyImmediate(oldObject);
}
planeObject.transform.SetPositionAndRotation(new Vector3(0, 0, 10), Quaternion.Euler(90, 0, 0));
planeObject.transform.localScale = new Vector3(10, -1, 10);
planeObject.AddComponent<Labeling>();

正在加载...
取消
保存