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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user