GearVRf icon indicating copy to clipboard operation
GearVRf copied to clipboard

Assign texture to loaded model result in crash

Open nitosan opened this issue 7 years ago • 1 comments

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

nitosan avatar Oct 13 '17 05:10 nitosan

@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.

liaxim avatar Oct 13 '17 20:10 liaxim