浏览代码

fix broken test

/validation-tool
Wesley Mareovich Smith 3 年前
当前提交
b8e58b57
共有 3 个文件被更改,包括 14 次插入11 次删除
  1. 8
      com.unity.perception/Editor/Character/CharacterTooling.cs
  2. 11
      com.unity.perception/Editor/Character/CharacterToolingUI.cs
  3. 6
      com.unity.perception/Tests/Editor/CharacterToolingTests.cs

8
com.unity.perception/Editor/Character/CharacterTooling.cs


/// <param name="drawRays"></param>
/// <param name="savePath"></param>
/// <returns></returns>
public bool CharacterCreateNose(GameObject selection, Object keypointTemplate, bool drawRays = false, string savePath = "Assets/")
public bool CharacterCreateNose(GameObject selection, out GameObject newModel,Object keypointTemplate, bool drawRays = false, string savePath = "Assets/")
var model = AvatarCreateNoseEars(selection, keypointTemplate, savePath, drawRays);
newModel = AvatarCreateNoseEars(selection, keypointTemplate, savePath, drawRays);
if (model.name.Contains("Failed"))
if (newModel.name.Contains("Failed"))
GameObject.DestroyImmediate(model);
GameObject.DestroyImmediate(newModel);
return false;
}
else return true;

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


var checkForJoints = m_contentTests.ValidateNoseAndEars(selection);
var failedBones = new Dictionary<HumanBone, bool>();
var failedPose = new List<GameObject>();
var newModel = new GameObject();
if (checkForJoints)
status = "Joints already exist";

if (!checkForJoints)
{
if (savePath == "Assets/")
apiResult = m_contentTests.CharacterCreateNose(selection, keypointTemplate, drawFaceRays);
apiResult = m_contentTests.CharacterCreateNose(selection, out newModel, keypointTemplate, drawFaceRays);
apiResult = m_contentTests.CharacterCreateNose(selection, keypointTemplate, drawFaceRays, savePath);
apiResult = m_contentTests.CharacterCreateNose(selection, out newModel, keypointTemplate, drawFaceRays, savePath);
if (apiResult)
var modelValidate = m_contentTests.ValidateNoseAndEars(newModel);
if (modelValidate)
else if (!apiResult)
else if (!modelValidate)
status = "Failed to create the Ear and Nose joints";
}
else if(checkForJoints)

6
com.unity.perception/Tests/Editor/CharacterToolingTests.cs


template = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(o);
}
}
var model = contentTests.CharacterCreateNose(gameObject, template, true);
var newModel = new GameObject();
var model = contentTests.CharacterCreateNose(gameObject, out newModel, template, true);
validate = contentTests.ValidateNoseAndEars(gameObject);
validate = contentTests.ValidateNoseAndEars(newModel);
else if (!model)
Assert.Fail("Failed to create the Ear and Nose Joints");

正在加载...
取消
保存