|
@@ -12,7 +12,9 @@ public class OBJToGLBUtil {
|
|
|
|
|
|
public static void objToGlb(String objPath, String glbPath) {
|
|
|
log.info("obj转换glb开始,{}",objPath);
|
|
|
- checkObj(objPath);
|
|
|
+ if(!checkObj(objPath)){
|
|
|
+ throw new BusinessException(-1,"obj文件错误");
|
|
|
+ }
|
|
|
objPath += "/mesh.obj";
|
|
|
log.info("obj转换glb开始");
|
|
|
String command = "obj2gltf " + objPath + " " + glbPath;
|
|
@@ -33,10 +35,10 @@ public class OBJToGLBUtil {
|
|
|
if(file2.isDirectory()){
|
|
|
return checkObj(file2.getPath());
|
|
|
}
|
|
|
- if(file2.getName().contains("obj") ){
|
|
|
+ if(file2.getName().contains(".obj") ){
|
|
|
objFile = file2;
|
|
|
}
|
|
|
- if(file2.getName().contains("mtl") ){
|
|
|
+ if(file2.getName().contains(".mtl") ){
|
|
|
mtlFile = file2;
|
|
|
}
|
|
|
}
|