setMorphWeights

actual fun setMorphWeights(instance: EntityInstance, weights: FloatArray, offset: Int)

Updates the vertex morphing weights on a renderable, all zeroes by default.

The renderable must be built with morphing enabled, see Builder.morphing(). In legacy morphing mode, only the first 4 weights are considered.

Parameters

instance

Instance of the component obtained from getInstance()

weights

Pointer to morph target weights to be updated.

offset

Index of the first morph target weight to set at instance.

expect fun setMorphWeights(instance: EntityInstance, weights: FloatArray, offset: Int = 0)

Updates the vertex morphing weights on a renderable, all zeroes by default.

The renderable must be built with morphing enabled, see Builder.morphing(). In legacy morphing mode, only the first 4 weights are considered.

Parameters

instance

Instance of the component obtained from getInstance()

weights

Pointer to morph target weights to be updated.

offset

Index of the first morph target weight to set at instance.

actual fun setMorphWeights(instance: EntityInstance, weights: FloatArray, offset: Int)

Updates the vertex morphing weights on a renderable, all zeroes by default.

The renderable must be built with morphing enabled, see Builder.morphing(). In legacy morphing mode, only the first 4 weights are considered.

Parameters

instance

Instance of the component obtained from getInstance()

weights

Pointer to morph target weights to be updated.

offset

Index of the first morph target weight to set at instance.

actual fun setMorphWeights(instance: EntityInstance, weights: FloatArray, offset: Int)

Updates the vertex morphing weights on a renderable, all zeroes by default.

The renderable must be built with morphing enabled, see Builder.morphing(). In legacy morphing mode, only the first 4 weights are considered.

Parameters

instance

Instance of the component obtained from getInstance()

weights

Pointer to morph target weights to be updated.

offset

Index of the first morph target weight to set at instance.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "degraded — filament.js binds only the legacy 4-scalar form, so weights past the 4th are dropped and a non-zero offset is ignored (1–3 weights are zero-padded and work).")
actual fun setMorphWeights(instance: EntityInstance, weights: FloatArray, offset: Int)

Weights beyond the first four are dropped and a non-zero offset is ignored: filament.js binds only the legacy setMorphWeights(instance, a, b, c, d) form, with no pointer/count/offset overload. Fewer than four weights are zero-padded, so 1–3 morph targets animate correctly.