University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Cannot run android example sbjniapp | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Cannot run android example sbjniapp
September 7, 2015
2:33 am
Avatar
Member
Members
Forum Posts: 22
Member Since:
August 23, 2015
sp_UserOfflineSmall Offline

Hi All,

I build sbjniapp success in my local machine, but when I run it in nexus 5, the sample character isn't being displayed, only see the TextView and button.  Then I install the apk in /android/sbjniapp download from svn, it can run well.  my code version is 6187.  this is my apk file : https://www.dropbox.com/s/zmuuq46efcyto1y/sbmjni.apk?dl=0

 

I have see the topic http://smartbody.ict.usc.edu/f.....of-android, but it no help for me. 

this is the log:

 -------------------------------------------------------------------------------------------------------------------

09-07 16:19:45.238: I/Adreno-EGL(19323): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
09-07 16:19:45.238: I/Adreno-EGL(19323): OpenGL ES Shader Compiler Version: E031.24.02.07
09-07 16:19:45.238: I/Adreno-EGL(19323): Build Date: 03/30/15 Mon
09-07 16:19:45.238: I/Adreno-EGL(19323): Local Branch:
09-07 16:19:45.238: I/Adreno-EGL(19323): Remote Branch:
09-07 16:19:45.238: I/Adreno-EGL(19323): Local Patches:
09-07 16:19:45.238: I/Adreno-EGL(19323): Reconstruct Branch:
09-07 16:19:45.278: W/Adreno-ES20(19323): <core_glHint:84>: GL_INVALID_ENUM
09-07 16:19:45.308: I/SBM(19323): Phoneme mapping from EL->EH already found, replacing with EL->L
09-07 16:19:45.318: I/SBM(19323): Phoneme mapping from T->D already found, replacing with T->D
09-07 16:19:45.338: I/libsbjniapp(19323): Before init python
09-07 16:19:45.338: I/SBM(19323): initialize module pyexpat, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _functools, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module itertools, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module cStringIO, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module cPickle, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module cmath, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module math, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module time, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module datetime, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _collections, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module operator, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _md5, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _sha, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _sha, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _sha256, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _sha512, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module select, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module fcntl, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _struct, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _ctypes_test, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _weakref, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module array, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module strop, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module future_builtins, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _random, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _bisect, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _heapq, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _fileio, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _functools, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _json, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _testcapi, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _hotshot, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _lsprof, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _locale, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _csv, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module unicodedata, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module parser, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module mmap, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module syslog, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module audioop, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module imageop, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module termios, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module resource, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module binascii, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _multibytecodec, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_kr, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_jp, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_cn, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_tw, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_hk, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _codecs_iso2022, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _multiprocessing, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _elementtree, result = 0
09-07 16:19:45.338: I/SBM(19323): initialize module _ctypes, result = 0
09-07 16:19:45.378: I/Timeline(19323): Timeline: Activity_idle id: android.os.BinderProxy@42e1de48 time:30956650
09-07 16:19:45.398: I/libsbjniapp(19323): Before init SBScene
09-07 16:19:45.398: I/SBM(19323): |--------------------------------------------|
09-07 16:19:45.398: I/SBM(19323): | data/sbm-common/scripts/brad.py |
09-07 16:19:45.398: I/SBM(19323): |--------------------------------------------|
09-07 16:19:45.398: I/SBM(19323): Loading [/sdcard/sbjniappdir/.]
09-07 16:19:45.898: I/SBM(19323): Loading image :/sdcard/sbjniappdir/./mesh/ChrBrad/ChrBrad_Flash_Dif.png 512 512 4
09-07 16:19:46.448: I/SBM(19323): handle deformableMesh = ChrBradFlash.dae
09-07 16:19:46.448: I/SBM(19323): Build Skinned Buffer
09-07 16:19:46.448: I/SBM(19323): dynamic mesh size = 7, skin weight size = 7
09-07 16:19:46.488: I/SBM(19323): meshIndexList size = 7
09-07 16:19:46.508: I/SBM(19323): nTotalVtxs = 2613, nTotalTris = 5032
09-07 16:19:46.618: I/SBM(19323): has mesh ChrBradFlash.dae, num. of vertices = 3181
09-07 16:19:46.658: I/SBM(19323): WARNING: BML::parse_bml_gaze(): <0x5950c86c> BML tag missing 0x58b65640= attribute.
09-07 16:19:46.748: I/SBM(19323): Program Error:
09-07 16:19:46.748: W/Adreno-ES20(19323): <core_glGetUniformLocation:2025>: GL_INVALID_VALUE

----------------------------------------------------------------------------------------------------------------------------------------------

 

Thanks!

Paul.

September 9, 2015
7:10 pm
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi Paul,

The problem is related to some OpenGL ES 1.0/2.0 rendering issue in the sbjni code. I have fixed the problem and updated the code. You can rebuild with the latest version and see if it works.

 

Thanks,

Andrew 

September 10, 2015
3:20 am
Avatar
Member
Members
Forum Posts: 22
Member Since:
August 23, 2015
sp_UserOfflineSmall Offline

Hi Andrew,

It works well now! Thanks!   

Paul.

September 11, 2015
3:56 am
Avatar
Member
Members
Forum Posts: 22
Member Since:
August 23, 2015
sp_UserOfflineSmall Offline

Andrew Feng said
Hi Paul,

The problem is related to some OpenGL ES 1.0/2.0 rendering issue in the sbjni code. I have fixed the problem and updated the code. You can rebuild with the latest version and see if it works.

 

Thanks,

Andrew 

Hi Andrew,

Thanks for your attention.  After sbjni works, I delete some code in sbjni and  create a new project, only want to show people with no motion. When I use data files in your example, the new project can works well, but use my own .sk and .dae files, it can not see the people.  this model scan by kinect, and use smartbody autorig, then generate .sk and .dae files.  I write an python script to instead of brad.py in the new project named main.py.  The main.py can works well in sbgui, but can not works in android. Please help me find what's the problem. Thanks!

main.py

-------------------------------------------------------------------------------------------

scene.setMediaPath('/sdcard/testsmartbodydir/')
scene.addAssetPath("script", ".")
scene.addAssetPath('motion', '.')
scene.addAssetPath("mesh", ".")
scene.loadAssets()
scene.setScale(1.0)

# set the default camera
camera = scene.getActiveCamera()
camera.setEye(0, 1, 2)
camera.setCenter(0, 0.92, 0.0)
camera.setUpVector(SrVec(0, 1, 0))
camera.setScale(1)
camera.setFov(1.0472)
camera.setFarPlane(10000)
camera.setNearPlane(0.1)

# map to the SmartBody standard
scene.run("zebra2-map.py")
zebra2Map = scene.getJointMapManager().getJointMap("zebra2")
bradSkeleton = scene.getSkeleton('model.sk')
commonSkeleton = scene.getSkeleton('common.sk')
zebra2Map.applySkeleton(bradSkeleton)
zebra2Map.applySkeleton(commonSkeleton)

brad = scene.createCharacter("model", "")
bradSkeleton = scene.createSkeleton("model.sk")
brad.setSkeleton(bradSkeleton)
bradHPR = SrVec(0, 0, 0)
brad.setHPR(bradHPR)
bradPos = SrVec(0.0, 0.5, 0.0)
brad.setPosition(bradPos)
brad.createStandardControllers()
# deformable mesh
brad.setStringAttribute("deformableMesh", "model.dae")
#brad.setStringAttribute('displayType', 'GPUmesh')

-------------------------------------------------------------------------------------------

the new project source: https://www.dropbox.com/s/g3ab9qiuqa434mb/TestSmartBody.zip?dl=0

this is the apk: https://www.dropbox.com/s/506pmyp37lly6ac/TestSmartBody.apk?dl=0

 

Thanks!

Paul. 

September 14, 2015
7:18 pm
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi Paul,

I checked your project and found that your mesh is using vertex colors instead of textures. Thus the mesh rendering is not working correctly for Android . I have updated the SmartBody rendering code under Android to handle vertex color correctly. Can you update the SmartBody and see if this fixes the rendering.

Thanks,

Andrew

September 15, 2015
6:30 am
Avatar
Member
Members
Forum Posts: 22
Member Since:
August 23, 2015
sp_UserOfflineSmall Offline

Hi Andrew,

It works, thanks for your help!

Paul.