David Catuhe 5 年之前
父节点
当前提交
47ab0fef56
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Meshes/mesh.ts

+ 4 - 0
src/Meshes/mesh.ts

@@ -2825,6 +2825,10 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns the current mesh
      * @returns the current mesh
      */
      */
     public synchronizeInstances(): Mesh {
     public synchronizeInstances(): Mesh {
+        if (this._geometry && this._geometry.meshes.length !== 1) {
+            this.makeGeometryUnique();
+        }
+
         for (var instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) {
         for (var instanceIndex = 0; instanceIndex < this.instances.length; instanceIndex++) {
             var instance = this.instances[instanceIndex];
             var instance = this.instances[instanceIndex];
             instance._syncSubMeshes();
             instance._syncSubMeshes();