Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

Assign texture to loaded model result in crash #1534

Open nitosan opened 7 years ago

nitosan commented 7 years ago

Version: 4.0

The following code will cause the app to close

GVRModelSceneObject dinoObj = gvrContext.getAssetLoader().loadModel("trex_mesh.fbx");
dinoObj.getTransform().setPosition(0,0,-10);
gvrContext.getMainScene().addSceneObject(dinoObj);

GVRTexture dinoTexture = gvrContext.getAssetLoader().loadTexture(new GVRAndroidResource(gvrContext, "trex_tex_diffuse.pkm"));
dinoObj.getRenderData().getMaterial().setMainTexture(dinoTexture);

Reproduce by sample project here. https://github.com/nitosan/GearVRf-bugs/tree/master/assign_texture

liaxim commented 7 years ago

@nitosan dinoTexture is a scene object without a mesh and render data. Somewhere among its children is the real thing. Jassimp generates a lot of transform-only nodes. You will need to search for the real node manually so while it is not a bug, it is a use case that can definitely use improvement.