mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 06:19:47 -05:00
added frame dispersion to animationImporterUtil
This commit is contained in:
parent
3fc8d074ed
commit
66716a84b0
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using VRMShaders;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
|
|
@ -185,7 +187,7 @@ namespace UniGLTF
|
|||
return string.Join("/", path);
|
||||
}
|
||||
|
||||
public static AnimationClip ConvertAnimationClip(GltfData data, glTFAnimation animation, IAxisInverter inverter, glTFNode root = null)
|
||||
public static async Task<AnimationClip> ConvertAnimationClip(GltfData data, glTFAnimation animation, IAxisInverter inverter, IAwaitCaller awaitCaller, glTFNode root = null)
|
||||
{
|
||||
var clip = new AnimationClip();
|
||||
clip.ClearCurves();
|
||||
|
|
@ -309,6 +311,7 @@ namespace UniGLTF
|
|||
Debug.LogWarningFormat("unknown path: {0}", channel.target.path);
|
||||
break;
|
||||
}
|
||||
await awaitCaller.NextFrameIfTimedOut();
|
||||
}
|
||||
return clip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,10 +136,7 @@ namespace UniGLTF
|
|||
foreach (var (key, gltfAnimation) in Enumerable.Zip(AnimationImporterUtil.EnumerateSubAssetKeys(GLTF), GLTF.animations, (x, y) => (x, y)))
|
||||
{
|
||||
await AnimationClipFactory.LoadAnimationClipAsync(key, () =>
|
||||
{
|
||||
var clip = AnimationImporterUtil.ConvertAnimationClip(Data, gltfAnimation, InvertAxis.Create());
|
||||
return Task.FromResult(clip);
|
||||
});
|
||||
AnimationImporterUtil.ConvertAnimationClip(Data, gltfAnimation, InvertAxis.Create(), awaitCaller));
|
||||
}
|
||||
|
||||
await awaitCaller.NextFrame();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user