fromGlbAsset static method
Future<FlutterSceneVrmAsset>
fromGlbAsset(
- String assetPath, {
- AssetBundle? bundle,
- VrmValidationMode validation = VrmValidationMode.strict,
- GltfUriResolver? uriResolver,
- FlutterSceneVrmBindingOptions? bindingOptions,
- int? jointPaletteCapacity,
Loads a VRM GLB asset into both flvtterm core and Flutter Scene.
Implementation
static Future<FlutterSceneVrmAsset> fromGlbAsset(
String assetPath, {
AssetBundle? bundle,
VrmValidationMode validation = VrmValidationMode.strict,
GltfUriResolver? uriResolver,
FlutterSceneVrmBindingOptions? bindingOptions,
int? jointPaletteCapacity,
}) async {
final data = await (bundle ?? rootBundle).load(assetPath);
return fromGlbBytes(
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes),
validation: validation,
uriResolver: uriResolver,
bindingOptions: bindingOptions,
jointPaletteCapacity: jointPaletteCapacity,
// The bundle's bytes were loaded for this call and nothing else
// changes them.
adoptBytes: true,
);
}