From e8762bcf9dc5d82f2ec5d7928d49f4c622afd1e9 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Thu, 14 Jun 2012 14:06:43 +0000 Subject: [PATCH] Fix to 3D texture triangulation procedure that might have caused an image of width or height == 0 to be produced (which caused later errors during textures merging). git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9496 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/textures/TriangulatedTexture.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java b/engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java index af0b4aee3..80cee1a22 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java @@ -524,7 +524,13 @@ import jme3tools.converters.ImageToAwt; // create the result image Format imageFormat = texture.getImage().getFormat(); int imageWidth = (int) (envelope.width * blenderContext.getBlenderKey().getGeneratedTexturePPU()); + if(imageWidth == 0) { + imageWidth = 1; + } int imageHeight = (int) (envelope.height * blenderContext.getBlenderKey().getGeneratedTexturePPU()); + if(imageHeight == 0) { + imageHeight = 1; + } ByteBuffer data = BufferUtils.createByteBuffer(imageWidth * imageHeight * (imageFormat.getBitsPerPixel() >> 3)); image = new Image(texture.getImage().getFormat(), imageWidth, imageHeight, data);