mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-04 13:45:04 +08:00
ddbc3b164b
* chore: rearrange package structure to have the package at the root * ci: update CI workflows * ci: fixing workflow bugs * ci: recurse building .zip package * ci: more fixes * ci: add back in the nadena.dev VPM repo * ci: fix tests
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using nadena.dev.modular_avatar.core.editor;
|
|
using NUnit.Framework;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace modular_avatar_tests.AnimateAddedBones
|
|
{
|
|
/// <summary>
|
|
/// This test verifies that merged animations which affect a bone newly added to an armature by Merge Armature
|
|
/// are properly adjusted for the new bone path.
|
|
/// </summary>
|
|
public class AnimateAddedBones : TestBase
|
|
{
|
|
[Test]
|
|
public void AnimatesAddedBones()
|
|
{
|
|
var prefab = CreatePrefab("AnimateAddedBones.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
var layerName = "merged";
|
|
|
|
var motion = findFxClip(prefab, layerName);
|
|
|
|
var cubeObject = prefab.transform.Find("Armature/Hips").GetChild(0).gameObject;
|
|
Assert.True(cubeObject.name.StartsWith("Cube$"));
|
|
|
|
var binding =
|
|
EditorCurveBinding.FloatCurve("Armature/Hips/" + cubeObject.name, typeof(Transform),
|
|
"localEulerAnglesRaw.x");
|
|
Assert.NotNull(AnimationUtility.GetEditorCurve(motion, binding));
|
|
}
|
|
}
|
|
} |