Class BlendShapeProviderExtensions
- Namespace
- Uralstech.AvLoader.Capabilities
Extensions for IBlendShapeProviders.
public static class BlendShapeProviderExtensions
- Inheritance
-
objectBlendShapeProviderExtensions
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
providerIBlendShapeProvidernamesReadOnlySpan<string>weightsSpan<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
currentIBlendShapeProvidernamesstring[]foundNamestringThe name of the found channel or null if not found.
Returns
SetWeights(IBlendShapeProvider, IReadOnlyDictionary<string, float>)
Sets multiple blendshape weights from a dictionary.
public static int SetWeights(this IBlendShapeProvider provider, IReadOnlyDictionary<string, float> values)
Parameters
providerIBlendShapeProvidervaluesIReadOnlyDictionary<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
providerIBlendShapeProvidernamesReadOnlySpan<string>weightsReadOnlySpan<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
providerIBlendShapeProvidervaluesReadOnlySpan<(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.