fromGlbAsset static method

Future<FlutterSceneVrmAsset> fromGlbAsset(
  1. String assetPath, {
  2. AssetBundle? bundle,
  3. VrmValidationMode validation = VrmValidationMode.strict,
  4. GltfUriResolver? uriResolver,
  5. FlutterSceneVrmBindingOptions? bindingOptions,
  6. 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,
  );
}