gltfio: expose getMaterialInstances to Java.

Tested locally by hacking gltf-viewer on Android, added the following
lines to MainActivity:

```kotlin
for (mat in modelViewer.asset!!.materialInstances) {
    Log.d("gltf-viewer", mat.name)
}
```
This commit is contained in:
Philip Rideout
2020-05-08 10:26:46 -07:00
parent a3fb5c41f1
commit 9a47178b3d
5 changed files with 51 additions and 4 deletions

View File

@@ -356,3 +356,11 @@ Java_com_google_android_filament_MaterialInstance_nGetName(JNIEnv* env, jclass,
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
return env->NewStringUTF(instance->getName());
}
extern "C"
JNIEXPORT jlong JNICALL
Java_com_google_android_filament_MaterialInstance_nGetMaterial(JNIEnv* env, jclass,
jlong nativeMaterialInstance) {
MaterialInstance* instance = (MaterialInstance*) nativeMaterialInstance;
return (jlong) instance->getMaterial();
}