From 37c77e98f44bba3dcac70f655a44ea2d72ccc301 Mon Sep 17 00:00:00 2001 From: Carolina Herbster Date: Tue, 24 Oct 2023 09:04:28 -0300 Subject: [PATCH] Fix instanced buffers of cloned meshes --- packages/dev/core/src/Meshes/instancedMesh.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/dev/core/src/Meshes/instancedMesh.ts b/packages/dev/core/src/Meshes/instancedMesh.ts index eb8e7e3cac8..821933b1b98 100644 --- a/packages/dev/core/src/Meshes/instancedMesh.ts +++ b/packages/dev/core/src/Meshes/instancedMesh.ts @@ -661,16 +661,16 @@ Mesh.prototype.registerInstancedBuffer = function (kind: string, stride: number) for (const instance of this.instances) { instance.instancedBuffers = {}; } + } - if (!this._userInstancedBuffersStorage) { - this._userInstancedBuffersStorage = { - data: {}, - vertexBuffers: {}, - strides: {}, - sizes: {}, - vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined, - }; - } + if (!this._userInstancedBuffersStorage) { + this._userInstancedBuffersStorage = { + data: {}, + vertexBuffers: {}, + strides: {}, + sizes: {}, + vertexArrayObjects: this.getEngine().getCaps().vertexArrayObject ? {} : undefined, + }; } // Creates an empty property for this kind