fix: NullReferenceExceptions from ShapeChangerPreview

This commit is contained in:
bd_ 2024-09-14 18:42:01 -07:00
parent faa8d210f2
commit 4e3001ad65

View File

@ -133,12 +133,18 @@ namespace nadena.dev.modular_avatar.core.editor
.ToImmutableList(); .ToImmutableList();
} }
public Task<IRenderFilterNode> Instantiate(RenderGroup group, IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context) public async Task<IRenderFilterNode> Instantiate(RenderGroup group, IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context)
{ {
var shapeValues = group.GetData<StaticContext>(); var shapeValues = group.GetData<StaticContext>();
var node = new Node(shapeValues, proxyPairs.First().Item2 as SkinnedMeshRenderer, _blendshapeCache); var node = new Node(shapeValues, proxyPairs.First().Item2 as SkinnedMeshRenderer, _blendshapeCache);
return node.Refresh(proxyPairs, context, 0); var rv = await node.Refresh(proxyPairs, context, 0);
if (rv == null)
{
context.Invalidate();
}
return node;
} }
private class Node : IRenderFilterNode private class Node : IRenderFilterNode