modular-avatar/UnitTests~/EasySetupOutfit/PreferFirstHipsMatch.cs
kaikoga 5359e3b006
chore: Fix non-VRChat support (#650)
* add referenced assembly

* remove unused usings

* MA Merge Blend Tree is VRC specific

because it expects VRC style Animator Layer setup

* PruneParametersPass is VRChat specific

* fix: use FindAvatarTransformInParents() to be more cross platform

* fix MergeArmatureHook: nop logic for PhysBones if we do not dedup PhysBones

* fix AnimatorCombiner: ignore VRC components when non-VRC

btw, is AnimatorCombiner VRC specific?

* conditional compile some VRChat specific tests
2024-02-12 14:59:23 +09:00

31 lines
1.2 KiB
C#

using System.Reflection;
using modular_avatar_tests;
using nadena.dev.modular_avatar.core.editor;
using NUnit.Framework;
using UnityEngine;
public class PreferFirstHipsMatch : TestBase
{
[Test]
public void SetupHeuristicPrefersFirstHipsMatch()
{
var root = CreateCommonPrefab("shapell.fbx");
#if MA_VRCSDK3_AVATARS
root.AddComponent<VRC.SDK3.Avatars.Components.VRCAvatarDescriptor>();
#endif
var root_hips = root.GetComponent<Animator>().GetBoneTransform(HumanBodyBones.Hips).gameObject;
var root_armature = root_hips.transform.parent.gameObject;
var root_secondary = CreateChild(root, "PBC");
var root_alt_hips = CreateChild(root_secondary, "Hips");
var outfit = CreateChild(root, "Outfit");
var outfit_armature = CreateChild(outfit, "Armature");
var outfit_hips = CreateChild(outfit_armature, "Hips");
Assert.IsTrue(EasySetupOutfit.FindBones(outfit, out var det_av_root, out var det_av_hips, out var det_outfit_hips));
Assert.AreSame(root, det_av_root);
Assert.AreSame(root_hips, det_av_hips);
Assert.AreSame(outfit_hips, det_outfit_hips);
}
}