-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Hello!
At first, thanks a lot for a great package!
There is a wrong behavior fo Mesh.clone for geometry and material cloning.
There is a problem:
@OverRide
Mesh clone([bool? recursive = true]) {
return Mesh(geometry?.clone(), material?.clone()).copy(this, recursive);
}
New Mesh with cloned geometry and material created, but after .copy(this, recursive) executed they are restored to source's.
copy function code snippet:
@OverRide
Mesh copy(Object3D source, [bool? recursive]) {
super.copy(source, false);
if (source is Mesh) {
if (source.morphTargetInfluences.isNotEmpty) {
morphTargetInfluences = source.morphTargetInfluences.sublist(0);
}
if (source.morphTargetDictionary != null) {
morphTargetDictionary = json.decode(json.encode(source.morphTargetDictionary));
}
material = source.material;
geometry = source.geometry;
}
return this;
}