FilamentInstance

actual class FilamentInstance

FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.

Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.

Key features:

  • Independent entity tree for each instance

  • Skeletal animation via getAnimator() (independent per-instance or shared from asset)

  • Material variant switching via applyMaterialVariant()

  • Skin/skeleton access for joint manipulation

  • Independent bounding box and transform root

Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.

See also

expect class FilamentInstance

FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.

Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.

Key features:

  • Independent entity tree for each instance

  • Skeletal animation via getAnimator() (independent per-instance or shared from asset)

  • Material variant switching via applyMaterialVariant()

  • Skin/skeleton access for joint manipulation

  • Independent bounding box and transform root

Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.

See also

actual class FilamentInstance

FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.

Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.

Key features:

  • Independent entity tree for each instance

  • Skeletal animation via getAnimator() (independent per-instance or shared from asset)

  • Material variant switching via applyMaterialVariant()

  • Skin/skeleton access for joint manipulation

  • Independent bounding box and transform root

Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.

See also

actual class FilamentInstance

FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.

Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.

Key features:

  • Independent entity tree for each instance

  • Skeletal animation via getAnimator() (independent per-instance or shared from asset)

  • Material variant switching via applyMaterialVariant()

  • Skin/skeleton access for joint manipulation

  • Independent bounding box and transform root

Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.

See also

actual class FilamentInstance(jsInstance: gltfio_FilamentInstance)

FilamentInstance provides access to a hierarchy of entities instanced from a glTF asset.

Every entity has a TransformManager component. Some entities also have Name or Renderable components. Instances share material and geometry data with the parent FilamentAsset but maintain independent entity hierarchies, transforms, and animation states.

Key features:

  • Independent entity tree for each instance

  • Skeletal animation via getAnimator() (independent per-instance or shared from asset)

  • Material variant switching via applyMaterialVariant()

  • Skin/skeleton access for joint manipulation

  • Independent bounding box and transform root

Animation ownership: Each instance has its own Animator, but it can also be obtained from the parent FilamentAsset. Using the asset's animator means all instances share the same animation frame; using instance animators allows independent control.

See also

Constructors

Link copied to clipboard
actual constructor()

Create a new FilamentInstance.

expect constructor()

Create a new FilamentInstance.

actual constructor()

Create a new FilamentInstance.

constructor(nativeHandle: CPointer<FilaFilamentInstance>?)
actual constructor()

Create a new FilamentInstance.

constructor(jsInstance: gltfio_FilamentInstance)
actual constructor()

Create a new FilamentInstance.

Properties

Link copied to clipboard
var nativeHandle: MemorySegment?
var nativeHandle: CPointer<FilaFilamentInstance>?

Functions

Link copied to clipboard
actual fun applyMaterialVariant(variantIndex: Int)

Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.

expect fun applyMaterialVariant(variantIndex: Int)

Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.

actual fun applyMaterialVariant(variantIndex: Int)

Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.

actual fun applyMaterialVariant(variantIndex: Int)

Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.

actual fun applyMaterialVariant(variantIndex: Int)

Applies the material variant at variantIndex to all primitives in this instance. Ignored if the index is out of bounds.

Link copied to clipboard
actual fun attachSkin(skinIndex: Int, target: Int)

Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.

expect fun attachSkin(skinIndex: Int, target: Int)

Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.

actual fun attachSkin(skinIndex: Int, target: Int)

Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.

actual fun attachSkin(skinIndex: Int, target: Int)

Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.

actual fun attachSkin(skinIndex: Int, target: Int)

Attaches the given skin to the given node entity, which must have an associated mesh with BONE_INDICES and BONE_WEIGHTS attributes. No-op if the skin index or target is invalid.

Link copied to clipboard
actual fun detachSkin(skinIndex: Int, target: Int)

Detaches the given skin from the given node entity. No-op if skin index or target is invalid.

expect fun detachSkin(skinIndex: Int, target: Int)

Detaches the given skin from the given node entity. No-op if skin index or target is invalid.

actual fun detachSkin(skinIndex: Int, target: Int)

Detaches the given skin from the given node entity. No-op if skin index or target is invalid.

actual fun detachSkin(skinIndex: Int, target: Int)

Detaches the given skin from the given node entity. No-op if skin index or target is invalid.

actual fun detachSkin(skinIndex: Int, target: Int)

Detaches the given skin from the given node entity. No-op if skin index or target is invalid.

Link copied to clipboard
actual fun getAnimator(): Animator

Returns the animation engine for this instance.

expect fun getAnimator(): Animator

Returns the animation engine for this instance.

actual fun getAnimator(): Animator

Returns the animation engine for this instance.

actual fun getAnimator(): Animator

Returns the animation engine for this instance.

actual fun getAnimator(): Animator

Returns the animation engine for this instance.

Link copied to clipboard
actual fun getAsset(): FilamentAsset

Gets the FilamentAsset that owns this instance.

expect fun getAsset(): FilamentAsset

Gets the FilamentAsset that owns this instance.

actual fun getAsset(): FilamentAsset

Gets the FilamentAsset that owns this instance.

actual fun getAsset(): FilamentAsset

Gets the FilamentAsset that owns this instance.

actual fun getAsset(): FilamentAsset

Gets the FilamentAsset that owns this instance.

Link copied to clipboard
actual fun getBoundingBox(): Box

Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.

expect fun getBoundingBox(): Box

Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.

actual fun getBoundingBox(): Box

Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.

actual fun getBoundingBox(): Box

Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.

actual fun getBoundingBox(): Box

Gets the axis-aligned bounding box from the min/max values in the glTF accessors, transformed for this instance.

Link copied to clipboard
actual fun getEntities(): IntArray

Gets the entities of this instance, one per glTF node. All have a Transform component; some also have a Renderable or Name component.

expect fun getEntities(): IntArray

Gets the entities of this instance, one per glTF node. All have a Transform component; some also have a Renderable or Name component.

actual fun getEntities(): IntArray

Gets the entities of this instance, one per glTF node. All have a Transform component; some also have a Renderable or Name component.

actual fun getEntities(): IntArray

Gets the entities of this instance, one per glTF node. All have a Transform component; some also have a Renderable or Name component.

actual fun getEntities(): IntArray

Gets the entities of this instance, one per glTF node. All have a Transform component; some also have a Renderable or Name component.

Link copied to clipboard
actual fun getEntityCount(): Int

Gets the number of entities returned by getEntities.

expect fun getEntityCount(): Int

Gets the number of entities returned by getEntities.

actual fun getEntityCount(): Int

Gets the number of entities returned by getEntities.

actual fun getEntityCount(): Int

Gets the number of entities returned by getEntities.

actual fun getEntityCount(): Int

Gets the number of entities returned by getEntities.

Link copied to clipboard
@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns 0 — filament.js exposes no joint API.")
actual fun getJointCountAt(skinIndex: Int): Int

Gets the number of joints in the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns 0 — filament.js exposes no joint API.")
expect fun getJointCountAt(skinIndex: Int): Int

Gets the number of joints in the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns 0 — filament.js exposes no joint API.")
actual fun getJointCountAt(skinIndex: Int): Int

Gets the number of joints in the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns 0 — filament.js exposes no joint API.")
actual fun getJointCountAt(skinIndex: Int): Int

Gets the number of joints in the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns 0 — filament.js exposes no joint API.")
actual fun getJointCountAt(skinIndex: Int): Int

Gets the number of joints in the skin at skinIndex.

Link copied to clipboard
@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns an empty array — filament.js exposes no joint API.")
actual fun getJointsAt(skinIndex: Int): IntArray

Gets the joint entities of the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns an empty array — filament.js exposes no joint API.")
expect fun getJointsAt(skinIndex: Int): IntArray

Gets the joint entities of the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns an empty array — filament.js exposes no joint API.")
actual fun getJointsAt(skinIndex: Int): IntArray

Gets the joint entities of the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns an empty array — filament.js exposes no joint API.")
actual fun getJointsAt(skinIndex: Int): IntArray

Gets the joint entities of the skin at skinIndex.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "returns an empty array — filament.js exposes no joint API.")
actual fun getJointsAt(skinIndex: Int): IntArray

Gets the joint entities of the skin at skinIndex.

Link copied to clipboard
@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "throws at runtime with embind 'unbound types' — the vector return type is unregistered in the web prebuilt.")
actual fun getMaterialInstances(): Array<MaterialInstance>

Gets all material instances of this instance. These are already bound to renderables.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "throws at runtime with embind 'unbound types' — the vector return type is unregistered in the web prebuilt.")
expect fun getMaterialInstances(): Array<MaterialInstance>

Gets all material instances of this instance. These are already bound to renderables.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "throws at runtime with embind 'unbound types' — the vector return type is unregistered in the web prebuilt.")
actual fun getMaterialInstances(): Array<MaterialInstance>

Gets all material instances of this instance. These are already bound to renderables.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "throws at runtime with embind 'unbound types' — the vector return type is unregistered in the web prebuilt.")
actual fun getMaterialInstances(): Array<MaterialInstance>

Gets all material instances of this instance. These are already bound to renderables.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "throws at runtime with embind 'unbound types' — the vector return type is unregistered in the web prebuilt.")
actual fun getMaterialInstances(): Array<MaterialInstance>

Gets all material instances of this instance. These are already bound to renderables.

Link copied to clipboard

Gets the names of all material variants declared in the asset, in variant-index order.

Gets the names of all material variants declared in the asset, in variant-index order.

Gets the names of all material variants declared in the asset, in variant-index order.

Gets the names of all material variants declared in the asset, in variant-index order.

Gets the names of all material variants declared in the asset, in variant-index order.

Link copied to clipboard
actual fun getRoot(): Int

Gets the transform root entity of this instance, which has no matching glTF node.

expect fun getRoot(): Int

Gets the transform root entity of this instance, which has no matching glTF node.

actual fun getRoot(): Int

Gets the transform root entity of this instance, which has no matching glTF node.

actual fun getRoot(): Int

Gets the transform root entity of this instance, which has no matching glTF node.

actual fun getRoot(): Int

Gets the transform root entity of this instance, which has no matching glTF node.

Link copied to clipboard
actual fun getSkinCount(): Int

Gets the number of skins declared in the asset.

expect fun getSkinCount(): Int

Gets the number of skins declared in the asset.

actual fun getSkinCount(): Int

Gets the number of skins declared in the asset.

actual fun getSkinCount(): Int

Gets the number of skins declared in the asset.

actual fun getSkinCount(): Int

Gets the number of skins declared in the asset.

Link copied to clipboard
actual fun getSkinNames(): Array<String>

Gets the names of all skins, in skin-index order.

expect fun getSkinNames(): Array<String>

Gets the names of all skins, in skin-index order.

actual fun getSkinNames(): Array<String>

Gets the names of all skins, in skin-index order.

actual fun getSkinNames(): Array<String>

Gets the names of all skins, in skin-index order.

actual fun getSkinNames(): Array<String>

Gets the names of all skins, in skin-index order.