mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-04 13:45:04 +08:00
efa263b551
* feat: add version defines for VRCSDK * chore: early return if VRCSDK project but not VRChat avatar
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
#if MA_VRCSDK3_AVATARS
|
|
|
|
using nadena.dev.modular_avatar.core.editor;
|
|
using NUnit.Framework;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace modular_avatar_tests
|
|
{
|
|
public class AnimParameterPathRewritingTest : TestBase
|
|
{
|
|
[Test]
|
|
public void test_AnimParameterPathRewriting()
|
|
{
|
|
var prefab = CreatePrefab("AnimParameterPathRewriting.prefab");
|
|
|
|
var originalClip = LoadAsset<AnimationClip>("clip.anim");
|
|
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
var origCurves = AnimationUtility.GetCurveBindings(originalClip);
|
|
Assert.AreEqual(1, origCurves.Length);
|
|
Assert.AreEqual("", origCurves[0].path);
|
|
Assert.AreEqual(typeof(Animator), origCurves[0].type);
|
|
Assert.AreEqual("p", origCurves[0].propertyName);
|
|
|
|
var curves = AnimationUtility.GetCurveBindings(findFxClip(prefab, "l1"));
|
|
Assert.AreEqual(1, curves.Length);
|
|
Assert.AreEqual("", curves[0].path);
|
|
Assert.AreEqual(typeof(Animator), curves[0].type);
|
|
Assert.AreEqual("x", curves[0].propertyName);
|
|
|
|
// Animation override controller handling
|
|
curves = AnimationUtility.GetCurveBindings(findFxClip(prefab, "l2"));
|
|
Assert.AreEqual(1, curves.Length);
|
|
Assert.AreEqual("", curves[0].path);
|
|
Assert.AreEqual(typeof(Animator), curves[0].type);
|
|
Assert.AreEqual("x", curves[0].propertyName);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |