|
|
@@ -7,6 +7,7 @@ import java.awt.image.BufferedImage;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.logging.Logger;
|
|
|
|
|
|
import jme3tools.converters.ImageToAwt;
|
|
|
|
|
|
@@ -39,6 +40,8 @@ import com.jme3.texture.Texture2D;
|
|
|
* @author Marcin Roguski (Kaelthas)
|
|
|
*/
|
|
|
public class CombinedTexture {
|
|
|
+ private static final Logger LOGGER = Logger.getLogger(CombinedTexture.class.getName());
|
|
|
+
|
|
|
/** The mapping type of the texture. Defined bu MaterialContext.MTEX_COL, MTEX_NOR etc. */
|
|
|
private final int mappingType;
|
|
|
/** The data for each of the textures. */
|
|
|
@@ -81,17 +84,21 @@ public class CombinedTexture {
|
|
|
if (!(texture instanceof GeneratedTexture) && !(texture instanceof Texture2D)) {
|
|
|
throw new IllegalArgumentException("Unsupported texture type: " + (texture == null ? "null" : texture.getClass()));
|
|
|
}
|
|
|
- TextureData textureData = new TextureData();
|
|
|
- textureData.texture = texture;
|
|
|
- textureData.textureBlender = textureBlender;
|
|
|
- textureData.uvCoordinatesType = UVCoordinatesType.valueOf(uvCoordinatesType);
|
|
|
- textureData.projectionType = UVProjectionType.valueOf(projectionType);
|
|
|
- textureData.textureStructure = textureStructure;
|
|
|
-
|
|
|
- if (this.isWithoutAlpha(textureData, blenderContext)) {
|
|
|
- textureDatas.clear();// clear previous textures, they will be covered anyway
|
|
|
- }
|
|
|
- textureDatas.add(textureData);
|
|
|
+ if(UVCoordinatesGenerator.isTextureCoordinateTypeSupported(UVCoordinatesType.valueOf(uvCoordinatesType))) {
|
|
|
+ TextureData textureData = new TextureData();
|
|
|
+ textureData.texture = texture;
|
|
|
+ textureData.textureBlender = textureBlender;
|
|
|
+ textureData.uvCoordinatesType = UVCoordinatesType.valueOf(uvCoordinatesType);
|
|
|
+ textureData.projectionType = UVProjectionType.valueOf(projectionType);
|
|
|
+ textureData.textureStructure = textureStructure;
|
|
|
+
|
|
|
+ if (this.isWithoutAlpha(textureData, blenderContext)) {
|
|
|
+ textureDatas.clear();// clear previous textures, they will be covered anyway
|
|
|
+ }
|
|
|
+ textureDatas.add(textureData);
|
|
|
+ } else {
|
|
|
+ LOGGER.warning("The texture coordinates type is not supported: " + UVCoordinatesType.valueOf(uvCoordinatesType) + ". The texture '" + textureStructure.getName() + "'.");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|