-
Notifications
You must be signed in to change notification settings - Fork 606
Convert mutliple .obj to .sfa and .sfb #217
Comments
Hi, I had a similar problem and found a solution using the sceneform convert binary direct from command line. I created a shell script to do the conversion. I also created a repo with the convert binaries too. Try using: https://github.com/necrostylery/google-ar-asset-converter |
Thanks for the link and your hint. I did the same and it works perfectly. But where did you find the converter program as well as matc? The SDK downloads of ARCore lack those two: |
I extracted them from the sceneform gradle plugin jar file. |
Great deed. But you don't get in Android Studio the message "File was loaded in the wrong encoding..." no matter if you reload it with UTF-8, -16, ISO-8859-1, or US-ASCII? The converter and matc files do not provide any enconding opentions if you call them with the "-h" parameter. |
Hi @ManuelTS, Maybe you should open a different issue for this problem. |
Done in issue #226. |
A manual import works now, but an self made automatic one via shell script not. The Sceneform plugin got updated to 1.4.0 |
Hi @ManuelTS ! I updated the repo binaries, please try again! |
Hi @necrostylery, sorry I got caught up in implementing other features of my app and now I'm back to generating multiple .sfb files, the error persists, I made a script to process all the ~3000 files. Since your update of binaries I redid the first two files of my database by hand, here the single commands:
But both generated .sfb files give me the aforementioned error. I'm startled, what am I doing wrong? /Edit: Maybe it is worth to mention that I have a instant app folder structure but I'm not running the instant app nor do I use any of its features. This causes the |
Hi @ManuelTS, |
Thank you for your support @necrostylery ! Of course I can: |
Hi @ManuelTS, I tried run this command:
That's the output messages:
and the output folder:
It worked normally for me, maybe is some problem with your OS system?? Have you tried with another computer? Sorry if I couldn't help more. |
I did the same with he same result, only difference is I used the converters from linux or from windows with executed with wine, respectively. All generated .sfb files show in Android Studio "File was loaded in the wrong encoding...". :( Can you, @necrostylery, please upload your generated files so I can open them with my Android Studio? For now only with my computer but I will try it with other ones and other OSs. You helped me a lot already, thank you very much for that 😄 |
Hmm. @ManuelTS now I see your problem. In fact the error occurred here as well. Maybe is a bug? Have you tried import this .obj file in some 3d designer software and re-exported the .obj file? Maybe have something inside that has an invalid character. These are the files I converted. |
@necrostylery propably a bug, no I have no since I cannot export circa 3000 files. As far as I know no special characters are in there. However, I will do exactly this for the two files attached here and I will report back. My full explanation and conclusion for the Sceneform developer team: I use objects from download # 9 from the BodyParts3D database. When I create a single sfa and .sfb out of an .obj file with the android studio importer wizard the file works, see #226. But creating one or multiple files via command line lets Android Studio, or rather its Sceneform plugin, say "File was loaded in the wrong encoding...". This applies to files created on Ubuntu 18.04, Windows 10, and Mac. Here the same single generated .sfa and .sfb files from .obj files from the Body Parts 3D database:
|
Ah, I think this is a bug that happens when your sfb doesn't correspond to a sfa that gradle recognizes. The viewer won't display it properly, but it should still render correctly if you include it in an app. |
This story has gone a long way and to be honest I don't care anymore, it takes too long and too much time, look at all the workarounds and tries before, I'm frustrated I cannot view the models in Android Studio. I know that the models render nonetheless in ARCore. Why the sceneform guys did not included a simple multiple file-to-.sfa-.sfb conversion is beyond me, new File().listFiles() should no be too hard to use, especially if you are a developer from Google. @necrostylery, using a graphical design program for regernating the .obj files results in the following: The two files imported into blender and exported create also FJxxxx.mtl files. Trying use the materials in the conversion results in
Using the original, standard material works, here the generated files with blender. Error is the same as before: |
Closing this as will not fix for now. |
A issue as feature request which is closed? Shouldn't you have written "will never fix"? |
Hi-- I am trying to get the sfb/sfa coverter running as a batch/command line for fbx files. Each fbx is self-contained with 3 built-in animations and png-based texture. Here is my problem. The Android Studio wizard does this import perfectly. Animations and all. I've attached the two generated .sfa JSON files (with .txt extension so they'd upload) for reference, along with a screenshot of the android studio wizard parameters. Any and all help greatly appreciated! |
In this topic on comment you have a bash script to give you an idea to convert multiple files. Also check out the dedicated repo google-ar-asset-converter of @gdamoreira. There you see how you get a short description explaining the single command line arguments of the converter. |
I have a solution download plugin Google sceneform tools (beta) v.11.1 update dependencies and again create the step import scneform from assets actually that works for me, on running app!!!!!!! :) |
I am downloading obj and mtl file using url in my Android app. Can anyone help how can I use sceneform plugin to convert them to sfb. @gdamoreira I have seen your converter but it is specifically for Windows and Linux. How can I write a script for my Android App? |
You canno't. Actually you can do only two things. First one is to convert you models into sfb and download them or the second one you can download your models as gltf files and then you can convert them at runtime in your app. |
With the import wizard in Android Studio which imports one Sceneform asset, allow to select a directory full of .obj files and to convert all of them as a batch to .sfa and .sfb files.
I have circa 3.000 .obj files, how can I convert them automatically to .sfa and .sfb files?
The text was updated successfully, but these errors were encountered: