From 467b80beb732c69401860de16b105c42c32302d9 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Sun, 19 May 2024 14:18:05 +0800 Subject: [PATCH] use locally scoped vars in js interop for easier debugging --- .../web/interop/js_interop_filament_viewer.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dart_filament/lib/dart_filament/compatibility/web/interop/js_interop_filament_viewer.dart b/dart_filament/lib/dart_filament/compatibility/web/interop/js_interop_filament_viewer.dart index 35991221..b54dfb06 100644 --- a/dart_filament/lib/dart_filament/compatibility/web/interop/js_interop_filament_viewer.dart +++ b/dart_filament/lib/dart_filament/compatibility/web/interop/js_interop_filament_viewer.dart @@ -201,9 +201,11 @@ class JsInteropFilamentViewer implements AbstractFilamentViewer { @override Future setMorphTargetWeights( FilamentEntity entity, List weights) async { - await _jsObject - .setMorphTargetWeights(entity, weights.map((x) => x.toJS).toList().toJS) - .toDart; + var jsWeights = weights.map((x) => x.toJS).cast().toList().toJS; + var promise = _jsObject.setMorphTargetWeights( + entity, jsWeights + ); + await promise.toDart; } @override @@ -240,8 +242,8 @@ class JsInteropFilamentViewer implements AbstractFilamentViewer { .toList() .toJS; var morphTargetsJs = - animation.morphTargets.map((x) => x.toJS).toList().toJS; - var targetMeshNamesJS = targetMeshNames?.map((x) => x.toJS).toList().toJS; + animation.morphTargets.map((x) => x.toJS).cast().toList().toJS; + var targetMeshNamesJS = targetMeshNames?.map((x) => x.toJS).cast().toList().toJS; await _jsObject .setMorphAnimationData(entity, animationDataJs, morphTargetsJs, targetMeshNamesJS, animation.frameLengthInMs)