dengsixing 1 nedēļu atpakaļ
vecāks
revīzija
2fc2894d5f

+ 17 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -1303,6 +1303,23 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         }).forEach(v->{
             fYunFileService.downloadFile(bucket, v, v.replace(meshOssPath, meshLocalPath));
         });
+        String meshJsonPath = meshLocalPath + "mesh.json";
+        if(FileUtil.exist(meshJsonPath)){
+            JSONObject meshJson = JSON.parseObject(FileUtil.readUtf8String(meshJsonPath));
+            JSONArray floors = meshJson.getJSONArray("floors");
+            for (Object floor : floors) {
+                JSONObject floorObj = (JSONObject)floor;
+                JSONArray lods = floorObj.getJSONArray("lods");
+                for (int i = 0; i < lods.size(); i++) {
+                    JSONObject lodObj = (JSONObject) lods.get(i);
+                    String objPath = lodObj.getString("objPath");
+                    if(!objPath.contains("lod_0")){
+                        lods.remove(i);
+                    }
+                }
+            }
+            FileUtil.writeUtf8String(meshJson.toJSONString(), meshJsonPath);
+        }
 //        fYunFileService.downloadFileByCommand(bucket, meshLocalPath, meshOssPath);
         //打包
         ZipUtil.zip(meshLocalPath,zipFilePath);