use locally scoped vars in js interop for easier debugging

This commit is contained in:
Nick Fisher
2024-05-19 14:18:05 +08:00
parent 4f9672cbbf
commit 467b80beb7

View File

@@ -201,9 +201,11 @@ class JsInteropFilamentViewer implements AbstractFilamentViewer {
@override
Future<void> setMorphTargetWeights(
FilamentEntity entity, List<double> weights) async {
await _jsObject
.setMorphTargetWeights(entity, weights.map((x) => x.toJS).toList().toJS)
.toDart;
var jsWeights = weights.map((x) => x.toJS).cast<JSNumber>().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<JSString>().toList().toJS;
var targetMeshNamesJS = targetMeshNames?.map((x) => x.toJS).cast<JSString>().toList().toJS;
await _jsObject
.setMorphAnimationData(entity, animationDataJs, morphTargetsJs,
targetMeshNamesJS, animation.frameLengthInMs)