Explorar el Código

Merge pull request #9203 from aWeirdo/patch-1

Update mesh.ts IncreaseVertices
David Catuhe hace 4 años
padre
commit
b1c025dd32
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      src/Meshes/mesh.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -354,6 +354,7 @@
 - Fix same sub mesh being rendered multiple times in the shadow map ([Popov72](https://github.com/Popov72))
 - Fix incorrect shadows on the master mesh when using a lod mesh ([Popov72](https://github.com/Popov72))
 - Take first gamepad connected when attaching camera (and not only XBOX gamepads) ([#9136](https://github.com/BabylonJS/Babylon.js/issues/9136)) ([RaananW](https://github.com/RaananW))
+- Fixed bug in `Mesh.IncreaseVertices` assuming null value if a property didn't exist. ([aWeirdo](https://github.com/aWeirdo))
 
 ## Breaking changes
 

+ 2 - 2
src/Meshes/mesh.ts

@@ -2713,7 +2713,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         var positions = vertex_data.positions;
         var normals = vertex_data.normals;
 
-        if (currentIndices === null || positions === null || normals === null || uvs === null) {
+        if (!currentIndices || !positions || !normals || !uvs) {
             Logger.Warn("VertexData contains null entries");
         }
         else {
@@ -4418,4 +4418,4 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     }
 }
 
-_TypeStore.RegisteredTypes["BABYLON.Mesh"] = Mesh;
+_TypeStore.RegisteredTypes["BABYLON.Mesh"] = Mesh;