Table of Contents

Class BlendShapeProviderExtensions

Extensions for IBlendShapeProviders.

public static class BlendShapeProviderExtensions
Inheritance
object
BlendShapeProviderExtensions

Methods

GetWeights(IBlendShapeProvider, ReadOnlySpan<string>, Span<float>)

Retrieves multiple blendshape weights into the provided buffer.

public static void GetWeights(this IBlendShapeProvider provider, ReadOnlySpan<string> names, Span<float> weights)

Parameters

provider IBlendShapeProvider
names ReadOnlySpan<string>
weights Span<float>

Remarks

Uses bulk access when available; otherwise falls back to per-channel access. Missing channel names result in zero values.

HasAnyWeight(IBlendShapeProvider, string[], out string?)

Checks if a channel with any one of the given names exists in the current provider.

public static bool HasAnyWeight(this IBlendShapeProvider current, string[] names, out string? foundName)

Parameters

current IBlendShapeProvider
names string[]
foundName string

The name of the found channel or null if not found.

Returns

bool

true if a channel was found; false otherwise.

SetWeights(IBlendShapeProvider, IReadOnlyDictionary<string, float>)

Sets multiple blendshape weights from a dictionary.

public static int SetWeights(this IBlendShapeProvider provider, IReadOnlyDictionary<string, float> values)

Parameters

provider IBlendShapeProvider
values IReadOnlyDictionary<string, float>

Returns

int

Remarks

This is a convenience overload; missing channel names are ignored.

SetWeights(IBlendShapeProvider, ReadOnlySpan<string>, ReadOnlySpan<float>)

Sets multiple blendshape weights.

public static int SetWeights(this IBlendShapeProvider provider, ReadOnlySpan<string> names, ReadOnlySpan<float> weights)

Parameters

provider IBlendShapeProvider
names ReadOnlySpan<string>
weights ReadOnlySpan<float>

Returns

int

The number of weights successfully applied.

Remarks

Uses bulk access when available; otherwise falls back to per-channel access. Missing channel names are ignored.

SetWeights(IBlendShapeProvider, ReadOnlySpan<(string name, float weight)>)

Sets multiple blendshape weights using name–value pairs.

public static int SetWeights(this IBlendShapeProvider provider, ReadOnlySpan<(string name, float weight)> values)

Parameters

provider IBlendShapeProvider
values ReadOnlySpan<(string name, float weight)>

Returns

int

The number of weights successfully applied.

Remarks

Uses bulk access when available; otherwise falls back to per-channel access. Missing channel names are ignored.