In what places is the boneMatrices property of the skeleton object recreated

In what places is the boneMatrices property of the skeleton object recreated ?

during mixer.update()
And I don’t think they are re-created, just updated?

1 Like

Bones inherit the Object3D calss, they are updated the same way.

1 Like

Are the boneMatrices array in the skeleton, pointers to the actual bone.matrix’es? i.e. not a separate copy?

1 Like

The’re definitely not the same:

.bones : Array

The array of bones. Note this is a copy of the original array, not a reference, so you can modify the original array without effecting this one.

Is the mixer.update() updating the inherited Object3D matrix or the sekeleton.bones array?

1 Like

I poked in the source for AnimationMixer: https://raw.githubusercontent.com/mrdoob/three.js/master/src/animation/AnimationMixer.js

I didn’t see any references to the skeleton.bones array or .bones … so maybe that array just contains the bones/matrices in the bind pose, in which case it’s just created at model load time, and not changed(?)

Afaik the actual bones in the scene get updated during mixer.update() (to position/rotation/scale) and then in renderer.render the matrices get updated/baked.

1 Like

After observing the behavior of the array for a long time during animations, I agree that it was mostly updated.

But when I replaced its buffer with a shared array buffer and started the animation on another thread, it recreated the array for me only for the skeleton (of course I didn’t check all the bones, but most of them remained with the same type of shared array buffer).

My mistake was that when I changed arraybuffer to sharedarraybuffer, I did not specify the property as maxByteLength which is recommended to be set to 2 times larger than the original

1 Like

are recreated when calling a .computeBoneTexture() on the skeleton. Which is called in the render if the skeleton is unknown .boneTexture