Skip to content

Commit 3683604

Browse files
committed
Merge remote-tracking branch 'origin/keypoints' into keypoints
2 parents b41d308 + ba80942 commit 3683604

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

com.unity.perception/Runtime/GroundTruth/Labelers/AnimationPoseLabel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ namespace UnityEngine.Perception.GroundTruth
1111
public class PoseTimestampRecord
1212
{
1313
/// <summary>
14-
/// The point in the clip that the pose starts, a value from 0 (beginning) to 1 (end)
14+
/// The percentage within the clip that the pose starts, a value from 0 (beginning) to 1 (end)
1515
/// </summary>
16-
public float startOffset;
16+
[Tooltip("The percentage within the clip that the pose starts, a value from 0 (beginning) to 1 (end)")]
17+
public float startOffsetPercent;
1718
/// <summary>
1819
/// The label to use for any captures inside of this time period
1920
/// </summary>
@@ -51,7 +52,7 @@ public string GetPoseAtTime(float time)
5152
var i = 1;
5253
for (i = 1; i < timestamps.Count; i++)
5354
{
54-
if (timestamps[i].startOffset > time) break;
55+
if (timestamps[i].startOffsetPercent > time) break;
5556
}
5657

5758
return timestamps[i - 1].poseLabel;

com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using UnityEngine;
43
using UnityEngine.Experimental.Perception.Randomization.Parameters;
54
using UnityEngine.Experimental.Perception.Randomization.Randomizers.SampleRandomizers.Tags;
@@ -16,8 +15,8 @@ public class AnimationRandomizer : Randomizer
1615
{
1716
FloatParameter m_FloatParameter = new FloatParameter{ value = new UniformSampler(0, 1) };
1817

19-
const string clipName = "PlayerIdle";
20-
const string stateName = "Base Layer.RandomState";
18+
const string k_ClipName = "PlayerIdle";
19+
const string k_StateName = "Base Layer.RandomState";
2120

2221
void RandomizeAnimation(AnimationRandomizerTag tag)
2322
{
@@ -27,8 +26,8 @@ void RandomizeAnimation(AnimationRandomizerTag tag)
2726
var overrider = tag.animatorOverrideController;
2827
if (overrider != null && tag.animationClips.GetCategoryCount() > 0)
2928
{
30-
overrider[clipName] = tag.animationClips.Sample();
31-
animator.Play(stateName, 0, m_FloatParameter.Sample());
29+
overrider[k_ClipName] = tag.animationClips.Sample();
30+
animator.Play(k_StateName, 0, m_FloatParameter.Sample());
3231
}
3332
}
3433

0 commit comments

Comments
 (0)