geometry.clone() doesn’t copy reference to bones/skinweights/animations etc.

There are a few things which geometry.clone() doesn’t copy a reference to, which it should.

.bones
.skinWeights
.skinIndices
.animations
.animation

are all left without references to the original, which leads to skinning being broken unless the references to those are manually copied. I think references should be passed as it’s less confusing, but I don’t think they should be deep copies, or this would lead to mostly wasted memory.

Author: Fantashit

2 thoughts on “geometry.clone() doesn’t copy reference to bones/skinweights/animations etc.

  1. Cloning an FBX model from Mixamo also breaks with the same issue: Skeleton/bones aren’t cloned. If you attempt to clone them manually, the entire model isn’t rendered at all.

    R87. Using the latest FBXLoader that was updated 8 days ago at time of writing.

  2. Following up here, #14494 includes a utility function to help with cloning skinned meshes:

    var copy = SkeletonUtils.clone( original );

    The object given as a parameter may be a SkinnedMesh or an Object3D or Scene containing one or more SkinnedMesh instances. Any bones referenced by the SkinnedMesh(es) must also be children of the given object.

Comments are closed.