add duplicate joint test

This commit is contained in:
ousttrue
2025-04-09 23:57:16 +09:00
parent c3338d3881
commit 1dd9372617
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using System.IO;
using System.Linq;
using NUnit.Framework;
using UnityEngine;
namespace VRM
{
public class VRMSpringBoneTests
{
static string AliciaPath
{
get
{
return Path.GetFullPath(Application.dataPath + "/../Tests/Models/Alicia_vrm-0.51/AliciaSolid_vrm-0.51.vrm")
.Replace("\\", "/");
}
}
[Test]
public void DuplicatedJoints()
{
using var loaded = TestVrm0X.LoadPathAsBuiltInRP(AliciaPath);
var sb = loaded.GetComponentInChildren<VRMSpringBone>();
// make duplicate #2617
sb.RootBones.Add(sb.RootBones[0].GetChild(0));
Assert.DoesNotThrow(() => sb.Setup());
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e52c8edc85e2460489f05eebc7f1f201
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: