CariusLars / ar_flutter_plugin

Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices
MIT License
322 stars 233 forks source link

Animated 3D models appears with animation only if type: NodeType.webGLB used for ARNode object. In other cases models are not animated or not displayed at all #67

Closed svyazist2005 closed 2 years ago

svyazist2005 commented 2 years ago

Animated 3D models appears with animation only if type: NodeType.webGLB used for ARNode object. In other cases models are not animated or not displayed at all

In case I use type: NodeType.localGLTF2, type:NodeType.fileSystemAppFolderGLB, NodeType.fileSystemAppFolderGLTF2 some models are displayed without animation(static) and some models are not displayed at all.

No errors, no warnings displayed

The model below IS displayed without animation with type:NodeType.localGLTF2, type:NodeType.fileSystemAppFolderGLB, type:NodeType.fileSystemAppFolderGLTF2 And is displayed animated in case we use type: NodeType.webGLB https://firebasestorage.googleapis.com/v0/b/stridenseek.appspot.com/o/files%2FAR_Models%2FAlien.glb?alt=media&token=fffd9db1-dcc5-4dae-bb1f-95d7ea867817

The model below is NOT displayed at all in case we use type:NodeType.localGLTF2, type:NodeType.fileSystemAppFolderGLB, type:NodeType.fileSystemAppFolderGLTF2 And is displayed animated in case we use type: NodeType.webGLB https://firebasestorage.googleapis.com/v0/b/stridenseek.appspot.com/o/files%2FAR_Models%2Fvelociraptor.glb?alt=media&token=565d3c81-b0b8-4c77-812a-469d706ca242

So the point is to make models to be displayed animated from the local storage not only from the web

client: IOS 14.7.1 IPHONE SE(old model) environment: ar_flutter_plugin: ^0.6.1 Flutter (Channel master, 2.6.0-12.0.pre.675, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-UA) Xcode - develop for iOS and macOS (Xcode 12.4) VS Code (version 1.48.2)

Please help to solve the issue, the download of large 3d models each time we access the AR page is inappropriate for our project

CariusLars commented 2 years ago

Hey @svyazist2005 , unfortunately animations are not supported by this plugin yet, so there is no standard behaviour here. If this is something you'd like to look into it would make a great contribution, don't hesitate to let me know if you need any help.

The model you provided (https://firebasestorage.googleapis.com/v0/b/stridenseek.appspot.com/o/files%2FAR_Models%2Fvelociraptor.glb?alt=media&token=565d3c81-b0b8-4c77-812a-469d706ca242) is a GLB file, so it won't work with type:NodeType.localGLTF2 and type:NodeType.fileSystemAppFolderGLTF2. To test it with type type:NodeType.fileSystemAppFolderGLB, I've added the link you supplied to line 112 of the local and web objects examle which downloads the model into the local file system when you start the widget and adds it as a fileSystemAppFolderGLB node when you press "Add/Remove Local Object at Origin" (please note that the initial download can take a while depending on your internet connection, so wait until your console prints "Downloading finished, path: /data/user/0/io.carius.lars.ar_flutter_plugin_example/app_flutter/LocalDuck.glb"). For me, the model displays without problems (see attached screenshot), so please test it with the same setup to check what happens :)

Attachment: IMAGE 2021-12-28 16:08:23