babakcode / o3d

The Flutter 3D objects easy controller ( glb format )
https://pub.dev/packages/o3d
BSD 3-Clause "New" or "Revised" License
32 stars 12 forks source link

availableAnimations works on Android, not iOS #11

Closed wesleycoats closed 3 weeks ago

wesleycoats commented 1 month ago

availableAnimations feature is not working on iOS. I took this same code from the pub dev page:

availableAnimations: use controller.availableAnimations().then((animations) => log("Available animations: $animations"));

It gets a parse error:

flutter: ModelViewer initializing... <http://127.0.0.1:60021/>
flutter: ModelViewer wants to load: http://127.0.0.1:60021/
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at character 1)
(
^

#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1380:5)
#1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1247:9)
#2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:912:22)
#3      _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4      JsonDecoder.convert (dart:convert/json.dart:610:36)
#5      JsonCodec.decode (dart:convert/json.dart:216:41)
#6      jsonDecode (dart:convert/json.dart:155:10)
#7      O3dImp.availableAnimations (package:o3d/src/controllers/implementation/o3d_stub_impl.dart:86:12)
<asynchronous suspension>
#8      _MyHomePageState.build.<anonymous closure> (package:animationsample/main.dart:148:52)
<asynchronous suspension>

I know this GLB has animations because it works on Android:

I/flutter (25510): Available animations: [Idle, Jump, Land, Run]

babakcode commented 1 month ago

I fixed this issue in the latest version. Please upgrade the package and share your feedback.

wesleycoats commented 1 month ago

@babakcode I upgraded to 3.1.1 and I am still seeing this issue on iOS

o3d
babakcode commented 1 month ago

Please upgrade to the version development and share your feedback. I fixed this issue.

wesleycoats commented 1 month ago

@babakcode it is working on iOS now. Thank you so much!