Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with other blender models #8

Closed
ghost opened this issue Apr 27, 2019 · 8 comments
Closed

Not working with other blender models #8

ghost opened this issue Apr 27, 2019 · 8 comments

Comments

@ghost
Copy link

ghost commented Apr 27, 2019

Hi @hemanthrajv
The example works out of the box if I update the gradle version to latest.

I am facing issues with loading a different model. I tried a couple of models and am getting the error

E/flutter (31925): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Unable to load asset: assets/BodyMesh.obj

Thank you again for sharing your awesome work.

Best
Chandra

@ghost
Copy link
Author

ghost commented Apr 27, 2019

PFA the file I am trying to use. Hope this helps. Please do let me know if there is some specific format that must be used to export the .obj file.

Thanks again.

zsmsxsymf1-BodyMesh.zip

@hemanthrajv
Copy link
Owner

Hi, thanks for writing to me. The library merely renders 3D object from .obj file.

Your body mesh does work perfect without any issues.

Here is the screenshot of your model
screenshot

Things you can check:

  • See if you've added the .obj file to assets correctly
  • Check if assets are specified properly in your pubspec.yaml
  • Ensure the asset name is correctly give to the Object3D class

Hope this helps!

@hemanthrajv
Copy link
Owner

Closing the issue as it is not plugin related.

Feel free to get back if the above methods did not help!

@ghost
Copy link
Author

ghost commented Apr 28, 2019

Hi @hemanthrajv
Can you let me know the platform you are using to test this ? If using an emulator, please let me know if tihs works on a real device.

The code compiles fine and I am getting run time error as mentioned above. Here is the exact info I get from my terminal.

I think this may be a run time issue related to my mobile. I am uisng Samsung Galaxy S8.

Let me know if you can help me with this.

Best
Chandra
<-------------------------------------------------------------------------------------------------------------------------------->
✝  ~/Downloads/flutter_3d_obj-master/example  flutter run
Launching lib/main.dart on SM G955U1 in debug mode...
Initializing gradle... 0.9s
Resolving dependencies... 1.5s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 1.4s
Built build/app/outputs/apk/debug/app-debug.apk.
D/SurfaceView(31925): destroy() Surface(name=SurfaceView - com.yourcompany.example/com.yourcompany.example.MainActivity@c2eb9d9@0[31925])/@0xc24da7f io.flutter.view.FlutterView{c2eb9
d9 VFE...... .F....ID 0,0-1080,2094}
I/Choreographer(31925): Skipped 101 frames! The application may be doing too much work on its main thread.
D/ViewRootImpl@5846f23MainActivity: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x3 surface={valid=true 498523344896} changed=false
D/vndksupport(31925): Loading /vendor/lib64/hw/[email protected] from current namespace instead of sphal namespace.
D/vndksupport(31925): Loading /vendor/lib64/hw/gralloc.msm8998.so from current namespace instead of sphal namespace.
E/flutter (31925): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Unable to load asset: assets/BodyMesh.obj
E/flutter (31925): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
E/flutter (31925):
E/flutter (31925): #1 AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:67:33)
E/flutter (31925):
E/flutter (31925): #2 CachingAssetBundle.loadString. (package:flutter/src/services/asset_bundle.dart:162:56)
E/flutter (31925): #3 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
E/flutter (31925): #4 CachingAssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:162:27)
E/flutter (31925): #5 _Object3DState.initState (package:flutter_3d_obj/flutter_3d_obj.dart:42:18)
E/flutter (31925): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3846:58)
E/flutter (31925): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
E/flutter (31925): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #10 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
E/flutter (31925): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter (31925): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter (31925): #15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
E/flutter (31925): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
E/flutter (31925): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter (31925): #20 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter (31925): #21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
E/flutter (31925): #22 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
E/flutter (31925): #23 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4063:11)
E/flutter (31925): #24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #25 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4982:32)
E/flutter (31925): #26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter (31925): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter (31925): #30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
E/flutter (31925): #31 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)
E/flutter (31925): #32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
E/flutter (31925): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter (31925): #36 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter (31925): #37 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
E/flutter (31925): #38 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
E/flutter (31925): #39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
E/flutter (31925): #40 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
E/flutter (31925): #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
E/flutter (31925): #42 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
E/flutter (31925): #43 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
E/flutter (31925): #44 StatefulElement._firstBuild (package:flutter/src/widget
I/OpenGLRenderer(31925): Davey! duration=1743ms; Flags=1, IntendedVsync=896177863416259, Vsync=896179546749525, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=896179547511988, AnimationStart=896179547719592, PerformTraversalsStart=896179547814748, DrawStart=896179572268550, SyncQueued=896179577274956, SyncStart=896179577383863, IssueDrawCommandsStart=896179577668967, SwapBuffers=896179603368810, FrameCompleted=896179607030946, DequeueBufferDuration=6627000, QueueBufferDuration=1852000,
D/ViewRootImpl@5846f23MainActivity: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 126) vi=Rect(0, 63 - 0, 126) or=1
Syncing files to device SM G955U1... 1,956ms

🔥 To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on SM G955U1 is available at: http://127.0.0.1:39453/
For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
Application finished.
✝  ~/Downloads/flutter_3d_obj-master/example 
<-------------------------------------------------------------------------------------------------------------------------------->

@ghost
Copy link
Author

ghost commented Apr 28, 2019

Screenshot from 2019-04-28 10-51-13
Screenshot from 2019-04-28 10-50-54

Screenshot_20190428-082103
Screenshot_20190428-082237

@ghost
Copy link
Author

ghost commented Apr 28, 2019

Hi @hemanthrajv
I renamed the file to abodymesh.obj and it works ok now. Maybe something to do with file name.

Best
Chandra

@ghost
Copy link
Author

ghost commented Apr 28, 2019

Screenshot_20190428-083113

@AbdullahAlAsad
Copy link

How can I add texture to this models ?
Also is there a way to pinch zoom ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants