|
@@ -36,7 +36,6 @@ public class ComputerUtil {
|
|
|
}
|
|
|
if("V3".equals(buildType)){
|
|
|
CreateObjUtil.build3dModel(path, "");
|
|
|
-// CreateObjUtil.build3dModel(unicode, "");
|
|
|
}
|
|
|
log.info("建模完成转换数据:"+projectNum);
|
|
|
|
|
@@ -61,7 +60,6 @@ public class ComputerUtil {
|
|
|
}
|
|
|
JSONObject fileJson = null;
|
|
|
String fileName = "";
|
|
|
- String meshfix = ""; //双模型时候会有改文件路径
|
|
|
for(int i = 0, len = array.size(); i < len; i++){
|
|
|
fileJson = array.getJSONObject(i);
|
|
|
fileName = fileJson.getString("file");
|
|
@@ -76,38 +74,24 @@ public class ComputerUtil {
|
|
|
}
|
|
|
|
|
|
//tex文件夹
|
|
|
- if(fileJson.getIntValue("clazz") == 2 && !fileJson.containsKey("pack-file")){
|
|
|
- if(fileName.contains("meshfix.txt")){
|
|
|
- meshfix = fileName;
|
|
|
- }else {
|
|
|
- map.put(path + File.separator + "results" +File.separator+ fileName,
|
|
|
- "images/images"+projectNum+"/"+ ConstantFileName.modelUUID+"_50k_texture_jpg_high1/"+fileName.replace("tex/", ""));
|
|
|
- }
|
|
|
+ if(fileJson.getIntValue("clazz") == 2 ){
|
|
|
+ map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+projectNum+"/"+ ConstantFileName.modelUUID+"_50k_texture_jpg_high1/"+fileName.replace("tex/", ""));
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
//high文件夹
|
|
|
if(fileJson.getIntValue("clazz") == 3){
|
|
|
- map.put(path + File.separator + "results" +File.separator+ fileName,
|
|
|
- "images/images"+ projectNum+"/pan/high/"+ fileName.replace("high/", ""));
|
|
|
+ map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+ projectNum+"/pan/high/"+ fileName.replace("high/", ""));
|
|
|
continue;
|
|
|
}
|
|
|
//low文件夹
|
|
|
if(fileJson.getIntValue("clazz") == 4){
|
|
|
- map.put(path + File.separator + "results" +File.separator+ fileName,
|
|
|
- "images/images"+ projectNum+"/pan/low/"+ fileName.replace("low/", ""));
|
|
|
+ map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+ projectNum+"/pan/low/"+ fileName.replace("low/", ""));
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- //tiles文件夹,亚马逊没有裁剪图片api,不需要上传4k图
|
|
|
-// if(fileJson.getIntValue("clazz") == 5 && !"s3".equals(ossType)){
|
|
|
-// map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
|
|
|
-// projectNum+ File.separator + fileName);
|
|
|
-// continue;
|
|
|
-// }
|
|
|
if(fileJson.getIntValue("clazz") == 5 ){
|
|
|
- map.put(path + File.separator + "results" + File.separator+ fileName,
|
|
|
- "images/images"+ projectNum+ File.separator + fileName);
|
|
|
+ map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+ projectNum+ File.separator + fileName);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -116,8 +100,7 @@ public class ComputerUtil {
|
|
|
if(fileName.contains("/4k_")){
|
|
|
continue;
|
|
|
}
|
|
|
- map.put(path + File.separator + "results" + File.separator+ fileName,
|
|
|
- "images/images"+ projectNum+ File.separator + fileName);
|
|
|
+ map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+ projectNum+ File.separator + fileName);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -137,15 +120,11 @@ public class ComputerUtil {
|
|
|
}
|
|
|
|
|
|
//video视频文件或封面图
|
|
|
- if(fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("cl" +
|
|
|
- "azz") == 12){
|
|
|
+ if(fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12){
|
|
|
map.put(path + File.separator + "results" + File.separator+ fileName,"video/video"+
|
|
|
projectNum+ File.separator + fileName.replace("videos/", ""));
|
|
|
|
|
|
if(fileName.contains(".mp4")){
|
|
|
-// CreateObjUtil.mp4ToFlv(path + File.separator + "results" + File.separator+ fileName,
|
|
|
-// path + File.separator + "results" + File.separator+ fileName.replace("mp4", "flv"));
|
|
|
-
|
|
|
map.put(path + File.separator + "results" + File.separator+ fileName.replace("mp4", "flv"),
|
|
|
"video/video"+ projectNum+ File.separator + fileName.replace("videos/", "").replace("mp4", "flv"));
|
|
|
}
|
|
@@ -153,55 +132,41 @@ public class ComputerUtil {
|
|
|
|
|
|
//2048的模型和贴图
|
|
|
if(fileJson.getIntValue("clazz") == 16){
|
|
|
- map.put(path + File.separator + "results" + File.separator+ fileName,
|
|
|
- "data/data"+ projectNum+ File.separator + fileName);
|
|
|
+ map.put(path + File.separator + "results" + File.separator+ fileName,"data/data"+ projectNum+ File.separator + fileName);
|
|
|
}
|
|
|
|
|
|
if(fileJson.getIntValue("clazz") == 18){
|
|
|
- map.put(path + File.separator + "results" + File.separator+ fileName,
|
|
|
- "images/images"+ projectNum+ File.separator + fileName);
|
|
|
+ map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+ projectNum+ File.separator + fileName);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k.dam");
|
|
|
CreateObjUtil.convertDamToLzma(path + File.separator + "results");
|
|
|
CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k.dam");
|
|
|
- //有meshfix,表示双模型
|
|
|
- if(!"".equals(meshfix)){
|
|
|
- CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+meshfix, path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
- CreateObjUtil.convertDamToLzma2(path + File.separator + "results");
|
|
|
- CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+meshfix, path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
- map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam.lzma",
|
|
|
- "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam.lzma");
|
|
|
- map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam",
|
|
|
- "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam");
|
|
|
- }
|
|
|
- //8目相机有两个vision.txt因此第二个叫vision2.txt
|
|
|
+
|
|
|
+
|
|
|
CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision.txt",path + File.separator + "results" +File.separator+"vision.modeldata");
|
|
|
+ map.put(path + File.separator + "results" +File.separator+"vision.txt","images/images"+projectNum+"/vision.txt");
|
|
|
+ map.put(path + File.separator + "results" + File.separator + "vision.modeldata", "images/images" + projectNum + "/vision.modeldata");
|
|
|
+
|
|
|
+ //8目相机有两个vision.txt因此第二个叫vision2.txt
|
|
|
if(vision2){
|
|
|
CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision2.txt",path + File.separator + "results" +File.separator+"vision2.modeldata");
|
|
|
- map.put(path + File.separator + "results" +File.separator+"vision2.modeldata",
|
|
|
- "images/images"+projectNum+"/"+"vision2.modeldata");
|
|
|
- }else {
|
|
|
- CreateObjUtil.convertTxtToVisionmodeldataCommon(path + File.separator + "results" +File.separator+"vision.txt",path + File.separator + "results" +File.separator+"vision.modeldata");
|
|
|
+ map.put(path + File.separator + "results" +File.separator+"vision2.modeldata","images/images"+projectNum+"/vision2.modeldata");
|
|
|
+ map.put(path + File.separator + "results" +File.separator+"vision2.txt","images/images"+projectNum+"/vision2.txt");
|
|
|
}
|
|
|
log.info("数据转换完成:"+projectNum);
|
|
|
|
|
|
File file = new File(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma");
|
|
|
- while(!file.exists())
|
|
|
- {
|
|
|
+ while(!file.exists()){
|
|
|
Thread.sleep(60000);
|
|
|
}
|
|
|
|
|
|
- map.put(path + File.separator + "results" +File.separator+"vision.modeldata",
|
|
|
- "images/images"+projectNum+"/"+"vision.modeldata");
|
|
|
- map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma",
|
|
|
- "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam.lzma");
|
|
|
- map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam",
|
|
|
- "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam");
|
|
|
+
|
|
|
+ map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", "images/images" + projectNum + "/" + ConstantFileName.modelUUID + "_50k.dam.lzma");
|
|
|
+ map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", "images/images" + projectNum + "/" + ConstantFileName.modelUUID + "_50k.dam");
|
|
|
file = new File(ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum);
|
|
|
- if(!file.exists())
|
|
|
- {
|
|
|
+ if(!file.exists()){
|
|
|
file.mkdir();
|
|
|
}
|
|
|
FileUtils.copyFile(path + File.separator + "results" +File.separator+"floor.json", ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum+File.separator+"floor.json", true);
|
|
@@ -210,7 +175,6 @@ public class ComputerUtil {
|
|
|
log.info("floor.json路径:"+ path + File.separator + "results" +File.separator+"floor.json");
|
|
|
map.put(path + File.separator + "results" +File.separator+"floor.json","data/data"+projectNum+"/floor.json");
|
|
|
map.put(path + File.separator + "results" +File.separator+"floorplan.json","data/data"+projectNum+"/floor.json");
|
|
|
-// map.put(path + File.separator + "results" +File.separator+"floorplan_cad.json","data/data"+projectNum+"/house_floor.json");
|
|
|
map.put(path + File.separator + "results" +File.separator+"floorplan_cad.json","data/data"+projectNum+"/floorplan_cad.json");
|
|
|
log.info("准备上传文件到oss:"+projectNum);
|
|
|
return map;
|