mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-09 22:07:45 -05:00
Merge branch 'master' into fix/impl_springbone_bake
This commit is contained in:
commit
81946e0167
|
|
@ -22,10 +22,14 @@ namespace VRM
|
|||
SpringBoneJobs.FastSpringBoneService m_service;
|
||||
FastSpringBoneBuffer m_buffer;
|
||||
|
||||
public Vrm0XFastSpringboneRuntime()
|
||||
{
|
||||
m_service = SpringBoneJobs.FastSpringBoneService.Instance;
|
||||
}
|
||||
|
||||
public async Task InitializeAsync(GameObject vrm, IAwaitCaller awaitCaller)
|
||||
{
|
||||
m_vrm = vrm;
|
||||
m_service = SpringBoneJobs.FastSpringBoneService.Instance;
|
||||
|
||||
// default update の停止
|
||||
foreach (VRMSpringBone sb in vrm.GetComponentsInChildren<VRMSpringBone>())
|
||||
|
|
@ -69,9 +73,8 @@ namespace VRM
|
|||
|
||||
public void ReconstructSpringBone()
|
||||
{
|
||||
var disposer = m_vrm.gameObject.GetComponent<FastSpringBoneDisposer>();
|
||||
Unregister();
|
||||
var task = RegisterAsync(new ImmediateCaller());
|
||||
var _ = RegisterAsync(new ImmediateCaller());
|
||||
}
|
||||
|
||||
public void RestoreInitialTransform()
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ namespace UniVRM10
|
|||
private FastSpringBones.FastSpringBoneService m_fastSpringBoneService;
|
||||
private FastSpringBoneBuffer m_fastSpringBoneBuffer;
|
||||
|
||||
public Vrm10FastSpringboneRuntime()
|
||||
{
|
||||
m_fastSpringBoneService = FastSpringBones.FastSpringBoneService.Instance;
|
||||
}
|
||||
|
||||
public void SetJointLevel(Transform joint, BlittableJointMutable jointSettings)
|
||||
{
|
||||
if (m_fastSpringBoneService.BufferCombiner.Combined is FastSpringBoneCombinedBuffer combined)
|
||||
|
|
@ -37,7 +42,6 @@ namespace UniVRM10
|
|||
|
||||
public async Task InitializeAsync(Vrm10Instance instance, IAwaitCaller awaitCaller)
|
||||
{
|
||||
m_fastSpringBoneService = FastSpringBones.FastSpringBoneService.Instance;
|
||||
m_instance = instance;
|
||||
|
||||
// NOTE: FastSpringBoneService は UnitTest などでは動作しない
|
||||
|
|
@ -49,8 +53,11 @@ namespace UniVRM10
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
m_fastSpringBoneService.BufferCombiner.Unregister(m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
if (m_fastSpringBoneBuffer != null)
|
||||
{
|
||||
m_fastSpringBoneService.BufferCombiner.Unregister(m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -286,14 +286,15 @@ namespace UniVRM10
|
|||
if (UniGLTF.Extensions.VRMC_springBone.GltfDeserializer.TryGet(Data.GLTF.extensions, out UniGLTF.Extensions.VRMC_springBone.VRMC_springBone springBone))
|
||||
{
|
||||
await LoadSpringBoneAsync(awaitCaller, controller, springBone);
|
||||
}
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// EditorImport では呼ばない
|
||||
// Vrm10Runtime で初期化していたが、 async にするためこちらに移動 v0.127
|
||||
// RuntimeGltfInstance にアクセスしたいのだが OnLoadHierarchy ではまだ attach されてなかった v0.128
|
||||
await m_springboneRuntime.InitializeAsync(controller, awaitCaller);
|
||||
}
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// EditorImport では呼ばない
|
||||
// Vrm10Runtime で初期化していたが、 async にするためこちらに移動 v0.127
|
||||
// RuntimeGltfInstance にアクセスしたいのだが OnLoadHierarchy ではまだ attach されてなかった v0.128
|
||||
// VRMC_springBone が無くても初期化する v0.127.2
|
||||
await m_springboneRuntime.InitializeAsync(controller, awaitCaller);
|
||||
}
|
||||
|
||||
// constraint
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user