When i'm trying to import sceneform assets and press finish on the window that pops up,nothing happens.No .sfa, .sfb files are generated.Nothing is generated in the build.gradle file also.I have to mention that i imported sceneform assets in the same project before and everything worked fine,but now (after a while) when i'm trying to do it again it doesn't work.
From https://developers.google.com/sceneform/develop/
Considering 1.15 and 1.17.1 identical, and these issues
- https://github.com/google-ar/sceneform-android-sdk/issues/1078
- https://github.com/google-ar/sceneform-android-sdk/issues/989
- https://github.com/google-ar/sceneform-android-sdk/issues/912
It looks like it's no longer in development and they are not going to fix it. It is problem with android studio version 3.6 and later.
There is no solution, either you can rollback to Android studio 3.5, or you can use a quick workaround.
Create a new sampledata directory in your application.
Right-click on top app level directory > New > Sample Data Directory
place your 3D assets and its dependencies (obj, mtl, fbx, png) into sampledata directory.
Add classpath 'com.google.ar.sceneform:plugin:1.15.0' to your project level gradle. make sure you have google() in repositories.
// Top-level build file where you can add configuration options. common to all sub-projects/modules buildscript { repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:4.0.1" classpath 'com.google.ar.sceneform:plugin:1.15.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }
sceneform requires a specific version of NDK and Java. And you need to apply plugin and dependencies since it will not be automatically added in recent versions of the android studio. apply plugin: 'com.android.application' apply plugin: 'com.google.ar.sceneform.plugin'
android { ... defaultConfig { ... ndk { /* * Sceneform is available for the following ABIs: arm64-v8a, armv7a, * x86_64 and x86. This sample app enables arm64-v8a to run on * devices and x86 to run on the emulator. Your application should * list the ABIs most appropriate to minimize APK size (arm64-v8a recommended). */ abiFilters 'arm64-v8a', 'x86' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } buildTypes { ... } } dependencies { ... implementation 'com.google.ar.sceneform:core:1.15.0' } < sceneform.asset code - 7th step >
I have added Mars 3D asset from Poly to my sampledata. Directory structure will look something like
Add raw data directory to resources.
Right-click on res > New > folder > Raw resources folder.Add this to the end of app-level gradle file.
sceneform.asset('sampledata/mars.obj', // 'Source Asset Path' specified during import. 'default', // 'Material Path' specified during import. 'sampledata/mars.sfa', // '.sfa Output Path' specified during import. 'src/main/res/raw/mars')
Sync files and it should work now.
Sceneform has Deprecates support for SFB & the SFB Sceneform Android Studio plugin (glTF can be used instead) - Release Notes
The documentation is available for sceneform 1.15.0 only -- which does not include glTF workflow. You can check out this demo for working with glTF.
I had the same problem, I noticed that you can do this without the plug-in by adding your model with sceneform.asset(...) in build.gradle and building the project, related .sfa and .sfb files are then created.
Sceneform 1.16 and 1.17 only supports gltf:
As part of the 1.16.0 release, support for SFA and SFB assets was removed in favor of adding glTF support
There is also a bug in Android Studio 3.6 and Sceneform Tools which makes Android Studio to crash (downgrading AS to 3.5 will help). If you want to use .fbx, you should downgrade to Sceneform 1.15 or you can use Sceneform 1.17 and gltf format
© 2022 - 2024 — McMap. All rights reserved.