浏览代码

changes to ui

/validation-tool
Wesley Mareovich Smith 4 年前
当前提交
7ebaf716
共有 2 个文件被更改,包括 18 次插入7 次删除
  1. 15
      com.unity.perception/Editor/Character/CharacterToolingLibrary.cs
  2. 10
      com.unity.perception/Editor/Character/CharacterToolingUI.cs

15
com.unity.perception/Editor/Character/CharacterToolingLibrary.cs


/// <returns></returns>
public static GameObject CreateNewCharacterPrefab(GameObject selection, Vector3 nosePosition, Vector3 earRightPosition, Vector3 earLeftPosition, Object keypointTemplate, string savePath = "Assets/")
{
var head = FindBodyPart("head", selection.transform);
var head = FindBodyPart(selection, HumanBodyBones.Head);
if (savePath == string.Empty || !Directory.Exists(savePath))
{

foreach (var child in children)
{
if (child.name == name || child.name.Contains("head"))
if (child.name == name || child.name.Contains(name))
}
public static Transform FindBodyPart(GameObject selection, HumanBodyBones humanBone)
{
var animator = selection.GetComponentInChildren<Animator>();
var targetBone = animator.GetBoneTransform(humanBone);
if (targetBone != null)
return targetBone;
else
return selection.transform;
}
/// <summary>

10
com.unity.perception/Editor/Character/CharacterToolingUI.cs


static string[] s_ToolbarNames = null;
CharacterTooling m_ContentTests = new CharacterTooling();
UnityEngine.Object m_KeypointTemplate;
Object m_KeypointTemplate;
GameObject m_Selection = null;
int m_ToolbarSelection = 0;

if(m_Selection != null)
{
var head = CharacterValidation.FindBodyPart("head", m_Selection.transform);
var leftEye = CharacterValidation.FindBodyPart("leftEye", m_Selection.transform);
var rightEye = CharacterValidation.FindBodyPart("rightEye", m_Selection.transform);
var head = CharacterValidation.FindBodyPart(m_Selection, HumanBodyBones.Head);
var leftEye = CharacterValidation.FindBodyPart(m_Selection, HumanBodyBones.LeftEye);
var rightEye = CharacterValidation.FindBodyPart(m_Selection, HumanBodyBones.RightEye);
if (head != null || leftEye != null || rightEye != null)
if (head != m_Selection.transform || leftEye != m_Selection.transform || rightEye != m_Selection.transform)
{
m_Status = "Character ready to add joints";
m_VaildCharacter = true;

正在加载...
取消
保存