API reference
API reference
Select your platform
No SDKs available
No versions available

GLXFInfo Class

Modifiers: final
GLXFInfo is a class that represents a GLXF file. Refer to readme for detailed specification.
A GLXFInfo is made whenever you use GLXFManager to inflate a glXF file. Here is an example of creating a GLXFInfo:
val myGLXFInfo = glXFManager.inflateGLXF(Uri.parse("apk:///scenes/Composition.glxf"))

Constructors

GLXFInfo ( glxfManager , version , experience , assets , nodes , rootEntity , uri , context , nodeMap , nodesByName , keyName , entityIdToEntityMap , overrideCreateEntity )
Parameters
glxfManager: GLXFManager
version: String  : the version of the GLXF file, e.g., "2.0"
experience: Boolean  : The experience property set to true indicates that this file is intended to be directly viewed as an experience and MUST NOT be imported into other scenes.
assets: MutableList  : a list of assets in the GLXF file
nodes: MutableList  : a list of nodes in the GLXF file
rootEntity: Entity  : the root entity of the GLXF file
uri: Uri  : the URI of the GLXF file
context: Context  : the context of the GLXF file, a.k.a. the Spatial Activity object.
nodeMap: NodeMap  : a map of entities to GLXFNodes
nodesByName: MutableMap  : a map of node names to GLXFNodes
keyName: String?  : the key name of the GLXF file. This optional value is used to uniquely identify the GLXF file.
entityIdToEntityMap: MutableMap
overrideCreateEntity: Function1
Returns
GLXFInfo

Properties

allMeshesLoaded : CompletableFuture
[Get]
A future that completes once every mesh-bearing entity in this glXF — including recursively-loaded nested glXFs — has its underlying SceneObject ready. Use this to defer actions like un-hiding inflated content until everything is on screen, avoiding the staggered pop-in that occurs as individual GLB meshes finish uploading on the GPU.
This future has stable identity for the lifetime of this GLXFInfo — it is created once at construction time, completed exactly once when the initial inflate's mesh assets finish loading, and then remains in a completed state. Callers may freely cache the reference and chain off it from any thread.
This is distinct from GLXFManager.inflateGLXF's onLoaded callback, which fires immediately after JSON+entity inflation completes — i.e. before GLB mesh uploads finish. onLoaded tells you "entities exist"; GLXFInfo.allMeshesLoaded tells you "all mesh assets are visible".
Completes immediately for a glXF with no mesh-bearing nodes.
Note: this future fires only for the initial inflate. Hot-reload via GLXFManager's reload APIs does not re-fire it (use the per-inflate onLoaded callback to observe reloads).
Signature
val allMeshesLoaded: CompletableFuture<Void>
experience : Boolean
[Get]
: The experience property set to true indicates that this file is intended to be directly viewed as an experience and MUST NOT be imported into other scenes.
Signature
val experience: Boolean
glxfManager : GLXFManager
[Get]
Signature
val glxfManager: GLXFManager
keyName : String?
[Get]
: the key name of the GLXF file. This optional value is used to uniquely identify the GLXF file.
Signature
val keyName: String? = null
nodes : MutableList
[Get][Set]
: a list of nodes in the GLXF file
Signature
var nodes: MutableList<GLXFNode>
rootEntity : Entity
[Get]
: the root entity of the GLXF file
Signature
val rootEntity: Entity
uri : Uri
[Get]
: the URI of the GLXF file
Signature
val uri: Uri
version : String
[Get]
: the version of the GLXF file, e.g., "2.0"
Signature
val version: String

Methods

destroy ()
Immediately destroys GLXFInfo and all its child resources including all entities inflated as part of the GLXFInfo.
Signature
fun destroy()
getNestedGLXFInfo ( childName )
Gets the nested GLXFInfo for a given child name.
Example:
val myNestedGLXFInfo = myGLXFInfo.getNestedGLXFInfo("childWithNestedGLXFName")

Signature
fun getNestedGLXFInfo(childName: String): GLXFInfo?
Parameters
childName: String  The name of the child node.
Returns
GLXFInfo?  The nested GLXFInfo object, or null if not found.
getNestedGLXFInfo ( childNamePathList )
Gets the nested GLXFInfo for a given list of child names. The first name should be the highest level child name, with each subsequent name being a child of that nested GLXFInfo
Example:
val myNestedGLXFInfo = myGLXFInfo.getNestedGLXFInfo(listOf("childOfMyGLXFInfo", "childOf_childOfMyGLXFInfo"))

Signature
fun getNestedGLXFInfo(childNamePathList: List<String>): GLXFInfo?
Parameters
childNamePathList: List  The list of child names.
Returns
GLXFInfo?  The nested GLXFInfo object, or null if not found.
getNodeByName ( name )
Returns the GLXFNode object for the given name. This gives you access to the node's properties, including the entity inf;ated to represent this node
Example:
val myPanelEntity = myGLXFInfo.getNodeByName("panel").entity

Signature
fun getNodeByName(name: String): GLXFNode
Parameters
name: String  The name of the node to retrieve.
Returns
GLXFNode  The GLXFNode object associated with the given name.
getNodeByName ( resId )
Returns the GLXFNode object for the string value represented by the resource ID.
Example:
val myPanelEntity = myGLXFInfo.getNodeByName(R.string.panel).entity

Signature
fun getNodeByName(resId: Int): GLXFNode
Parameters
resId: Int  The resource ID of the node to retrieve.
Returns
GLXFNode  The GLXFNode object associated with the given resource ID.
getNodeEntitiesWithNames ()
Gets map of all entities in the GLXFInfo, keyed by their names. Nodes without names will not be included.
Signature
fun getNodeEntitiesWithNames(): Map<String, Entity>
Returns
Map
tryGetNodeByName ( name )
Returns the GLXFNode object for the given name, or null if it doesn't exist.
Example:
val myPanelEntity = myGLXFInfo.tryGetNodeByName("panel").entity ?: return

Signature
fun tryGetNodeByName(name: String): GLXFNode?
Parameters
name: String  The name of the node to retrieve.
Returns
GLXFNode?  The GLXFNode object associated with the given name, or null if it doesn't exist.
tryGetNodeByName ( resId )
Returns the GLXFNode object for the given resource ID, or null if it doesn't exist.
Example:
val myPanelEntity = myGLXFInfo.tryGetNodeByName(R.string.panel).entity ?: return

Signature
fun tryGetNodeByName(resId: Int): GLXFNode?
Parameters
resId: Int  The resource ID of the node to retrieve.
Returns
GLXFNode?  The GLXFNode object associated with the given resource ID, or null if it doesn't exist.