diff --git a/android/gltfio-android/src/main/cpp/FilamentAsset.cpp b/android/gltfio-android/src/main/cpp/FilamentAsset.cpp
index d4031df5c8..252af29582 100644
--- a/android/gltfio-android/src/main/cpp/FilamentAsset.cpp
+++ b/android/gltfio-android/src/main/cpp/FilamentAsset.cpp
@@ -192,6 +192,15 @@ Java_com_google_android_filament_gltfio_FilamentAsset_nGetName(JNIEnv* env, jcla
return val ? env->NewStringUTF(val) : nullptr;
}
+extern "C" JNIEXPORT jstring JNICALL
+Java_com_google_android_filament_gltfio_FilamentAsset_nGetExtras(JNIEnv* env, jclass,
+ jlong nativeAsset, jint entityId) {
+ Entity entity = Entity::import(entityId);
+ FilamentAsset* asset = (FilamentAsset*) nativeAsset;
+ const auto val = asset->getExtras(entity);
+ return val ? env->NewStringUTF(val) : nullptr;
+}
+
extern "C" JNIEXPORT jlong JNICALL
Java_com_google_android_filament_gltfio_FilamentAsset_nGetAnimator(JNIEnv* , jclass,
jlong nativeAsset) {
diff --git a/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/FilamentAsset.java b/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/FilamentAsset.java
index 81b9560168..5f5105c2dd 100644
--- a/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/FilamentAsset.java
+++ b/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/FilamentAsset.java
@@ -186,6 +186,16 @@ public class FilamentAsset {
return nGetName(getNativeObject(), entity);
}
+ /**
+ * Gets the glTF extras string for the asset or a specific node.
+ *
+ * @param entity the entity corresponding to the glTF node, or 0 to get the asset-level string.
+ * @return the requested extras string, or null if it does not exist.
+ */
+ public @Nullable String getExtras(@Entity int entity) {
+ return nGetExtras(mNativeObject, entity);
+ }
+
/**
* Creates or retrieves the Animator interface for this asset.
*
@@ -252,6 +262,7 @@ public class FilamentAsset {
private static native void nGetBoundingBox(long nativeAsset, float[] box);
private static native String nGetName(long nativeAsset, int entity);
+ private static native String nGetExtras(long nativeAsset, int entity);
private static native long nGetAnimator(long nativeAsset);
private static native int nGetResourceUriCount(long nativeAsset);
private static native void nGetResourceUris(long nativeAsset, String[] result);
diff --git a/libs/gltfio/include/gltfio/FilamentAsset.h b/libs/gltfio/include/gltfio/FilamentAsset.h
index e9ff11b96c..b26cf41514 100644
--- a/libs/gltfio/include/gltfio/FilamentAsset.h
+++ b/libs/gltfio/include/gltfio/FilamentAsset.h
@@ -189,6 +189,9 @@ public:
size_t getEntitiesByPrefix(const char* prefix, utils::Entity* entities,
size_t maxCount) const noexcept;
+ /** Gets the glTF extras string for a specific node, or for the asset, if it exists. */
+ const char* getExtras(utils::Entity entity = {}) const noexcept;
+
/**
* Lazily creates the animation engine or returns it from the cache.
*
diff --git a/libs/gltfio/src/AssetLoader.cpp b/libs/gltfio/src/AssetLoader.cpp
index f64f8ed388..e0317d8189 100644
--- a/libs/gltfio/src/AssetLoader.cpp
+++ b/libs/gltfio/src/AssetLoader.cpp
@@ -39,6 +39,7 @@
#include