浏览代码

Add a default animation to animation controller

/main
Steven Borkman 4 年前
当前提交
dcac62db
共有 5 个文件被更改,包括 1027 次插入12 次删除
  1. 20
      com.unity.perception/Runtime/GroundTruth/Labelers/KeyPointLabeler.cs
  2. 6
      com.unity.perception/Runtime/GroundTruth/Resources/AnimationRandomizerController.controller
  3. 4
      com.unity.perception/Runtime/Randomization/Randomizers/RandomizerExamples/Randomizers/AnimationRandomizer.cs
  4. 1001
      com.unity.perception/Runtime/GroundTruth/Resources/PlayerIdle.anim
  5. 8
      com.unity.perception/Runtime/GroundTruth/Resources/PlayerIdle.anim.meta

20
com.unity.perception/Runtime/GroundTruth/Labelers/KeyPointLabeler.cs


string GetPose(Animator animator)
{
var info = animator.GetCurrentAnimatorClipInfo(0);
var clip = info[0].clip;
var timeOffset = animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
if (poseStateConfigs != null)
if (info != null && info.Length > 0)
foreach (var p in poseStateConfigs)
var clip = info[0].clip;
var timeOffset = animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
if (poseStateConfigs != null)
if (p.animationClip == clip)
foreach (var p in poseStateConfigs)
var time = timeOffset;
var label = p.GetPoseAtTime(time);
return label;
if (p.animationClip == clip)
{
var time = timeOffset;
var label = p.GetPoseAtTime(time);
return label;
}
}
}
}

6
com.unity.perception/Runtime/GroundTruth/Resources/AnimationRandomizerController.controller


m_Controller: {fileID: 9100000}
--- !u!1107 &1300458365308884037
AnimatorStateMachine:
serializedVersion: 6
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}

m_DefaultState: {fileID: 3212544235944076811}
--- !u!1102 &3212544235944076811
AnimatorState:
serializedVersion: 6
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}

m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 3f8d204fb62cf440aacbef0b85ff6858, type: 2}
m_Motion: {fileID: 7400000, guid: c61460273d36d0b4e936b68977241e58, type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:

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


{
FloatParameter m_FloatParameter = new FloatParameter{ value = new UniformSampler(0, 1) };
const string clipName = "Idle";
const string clipName = "PlayerIdle";
const string stateName = "Base Layer.RandomState";
void RandomizeAnimation(AnimationRandomizerTag tag)

/// <inheritdoc/>
protected override void OnIterationStart()
{
if (m_FloatParameter == null) m_FloatParameter = new FloatParameter{ value = new UniformSampler(0, 1) };
var taggedObjects = tagManager.Query<AnimationRandomizerTag>();
foreach (var taggedObject in taggedObjects)
{

1001
com.unity.perception/Runtime/GroundTruth/Resources/PlayerIdle.anim
文件差异内容过多而无法显示
查看文件

8
com.unity.perception/Runtime/GroundTruth/Resources/PlayerIdle.anim.meta


fileFormatVersion: 2
guid: 11ff68761e3b74dbd84106361e9a4ec7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存