* Forgot to commit proper exception for generated textures in MatParams
* OBJ/MTL loaders now use logger instead of System.out for warnings git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8007 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
e5be9cef83
commit
2ddc537ddc
@ -47,9 +47,13 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class MTLLoader implements AssetLoader {
|
public class MTLLoader implements AssetLoader {
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(MTLLoader.class.getName());
|
||||||
|
|
||||||
protected Scanner scan;
|
protected Scanner scan;
|
||||||
protected MaterialList matList;
|
protected MaterialList matList;
|
||||||
//protected Material material;
|
//protected Material material;
|
||||||
@ -242,7 +246,7 @@ public class MTLLoader implements AssetLoader {
|
|||||||
// Ke: emission color
|
// Ke: emission color
|
||||||
skipLine();
|
skipLine();
|
||||||
}else{
|
}else{
|
||||||
System.out.println("Unknown statement in MTL! "+cmd);
|
logger.log(Level.WARNING, "Unknown statement in MTL! {0}", cmd);
|
||||||
skipLine();
|
skipLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ import com.jme3.scene.VertexBuffer.Type;
|
|||||||
import com.jme3.scene.mesh.IndexBuffer;
|
import com.jme3.scene.mesh.IndexBuffer;
|
||||||
import com.jme3.scene.mesh.IndexIntBuffer;
|
import com.jme3.scene.mesh.IndexIntBuffer;
|
||||||
import com.jme3.scene.mesh.IndexShortBuffer;
|
import com.jme3.scene.mesh.IndexShortBuffer;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
@ -61,7 +62,6 @@ import java.util.Map.Entry;
|
|||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads OBJ format models.
|
* Reads OBJ format models.
|
||||||
@ -321,6 +321,8 @@ public final class OBJLoader implements AssetLoader {
|
|||||||
if (!name.toLowerCase().endsWith(".mtl"))
|
if (!name.toLowerCase().endsWith(".mtl"))
|
||||||
throw new IOException("Expected .mtl file! Got: " + name);
|
throw new IOException("Expected .mtl file! Got: " + name);
|
||||||
|
|
||||||
|
// NOTE: Cut off any relative/absolute paths
|
||||||
|
name = new File(name).getName();
|
||||||
matList = (MaterialList) assetManager.loadAsset(key.getFolder() + name);
|
matList = (MaterialList) assetManager.loadAsset(key.getFolder() + name);
|
||||||
|
|
||||||
if (matList != null){
|
if (matList != null){
|
||||||
@ -373,7 +375,7 @@ public final class OBJLoader implements AssetLoader {
|
|||||||
nextStatement();
|
nextStatement();
|
||||||
}else{
|
}else{
|
||||||
// skip entire command until next line
|
// skip entire command until next line
|
||||||
System.out.println("Unknown statement in OBJ! "+cmd);
|
logger.log(Level.WARNING, "Unknown statement in OBJ! {0}", cmd);
|
||||||
nextStatement();
|
nextStatement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,6 +207,10 @@ public class MatParam implements Savable, Cloneable {
|
|||||||
case TextureCubeMap:
|
case TextureCubeMap:
|
||||||
Texture texVal = (Texture) value;
|
Texture texVal = (Texture) value;
|
||||||
TextureKey texKey = (TextureKey) texVal.getKey();
|
TextureKey texKey = (TextureKey) texVal.getKey();
|
||||||
|
if (texKey == null){
|
||||||
|
throw new UnsupportedOperationException("The specified MatParam cannot be represented in J3M");
|
||||||
|
}
|
||||||
|
|
||||||
String ret = "";
|
String ret = "";
|
||||||
if (texKey.isFlipY()) {
|
if (texKey.isFlipY()) {
|
||||||
ret += "Flip ";
|
ret += "Flip ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user