Skip to content

Commit b00b58f

Browse files
committed
cleanup debug statements and comments
1 parent 7b5ce73 commit b00b58f

File tree

1 file changed

+3
-72
lines changed

1 file changed

+3
-72
lines changed

unity/Assets/THORExporter/DownloadThorAssets.cs

+3-72
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ void GatherGameObjectsFromPrefabsAndSave(string directoryPath, bool applyBoundin
330330
"Entryway Objects",
331331
"RoboTHOR_Assets_Environment"
332332
};
333+
333334
string[] prefabFiles = GetFilesExcludingDirectories(directoryPath, "*.prefab", excludeDirectories);
334335

335336
// Filter out prefabs that contain "Sliced" in their names
@@ -338,12 +339,6 @@ void GatherGameObjectsFromPrefabsAndSave(string directoryPath, bool applyBoundin
338339
int assetsProcessed = 0;
339340
foreach (string prefabPath in prefabFiles)
340341
{
341-
// skip if already exist
342-
//if (File.Exists(Path.Combine(savePath, GetRelativePath(assetPath, prefabPath).Replace(".prefab", ".obj"))))
343-
//{
344-
// Debug.Log("Skipping " + prefabPath);
345-
// continue;
346-
//}
347342

348343
string relativePrefabPath = GetRelativePath(assetPath, prefabPath);
349344
Debug.Log("Prefab path: " + relativePrefabPath);
@@ -430,8 +425,6 @@ void SaveEachAsset(GameObject go, string relativeExportPath, bool applyBoundingB
430425
Debug.Log("No bounding box found for " + go.name);
431426
}
432427

433-
//Debug.Log("saving mesh1" + center.ToString());
434-
435428
//SaveMeshes(relativeExportPath, meshFilters, center, applyBoundingBox, saveSubMeshes, saveSubMeshTransform, false);
436429
if(saveCombinedSubmeshes)
437430
{
@@ -447,9 +440,6 @@ void SaveEachAsset(GameObject go, string relativeExportPath, bool applyBoundingB
447440
);
448441
}
449442

450-
451-
//Debug.Log("saving mesh2");
452-
453443
if (!skipMaterialExport)
454444
{
455445
Debug.Log("saving material");
@@ -557,16 +547,6 @@ public MeshData FillMeshData(MeshFilter meshfilter, string meshName, SimObjPhysi
557547
}
558548
}
559549

560-
// foreach (ColliderInfo cInfo in meshData.primitiveColliders.myPrimitiveColliders)
561-
// {
562-
// if (cInfo.type == "mesh")
563-
// {
564-
// Debug.Log("Mesh Collider found on " + meshData.meshName + " clearing all colliders");
565-
// meshData.primitiveColliders.myPrimitiveColliders.Remove(cInfo);
566-
// break;
567-
// }
568-
// }
569-
570550
return meshData;
571551
}
572552

@@ -875,19 +855,6 @@ private void AddCollidersRecursive(Transform sibling, ref MeshData meshData, Gam
875855
}
876856
}
877857

878-
// private bool IsSimObjPhysicsFound(Transform target, GameObject reference)
879-
// {
880-
// // Return true if SimObjPhysics is found on the target or any descendant
881-
// if (target.GetComponent("SimObjPhysics") != null) return true;
882-
883-
// foreach (Transform child in target)
884-
// {
885-
// if (IsSimObjPhysicsFound(child, reference)) return true;
886-
// }
887-
888-
// return false;
889-
// }
890-
891858
public ColliderInfo GetColliderInfo(Collider collider)
892859
{
893860
string colliderType = collider.GetType().Name.ToLower().Replace("collider", "");
@@ -1340,6 +1307,8 @@ string ExportTexture(Texture2D t)
13401307

13411308
}
13421309

1310+
//////////////// Alvaro Collider serialization Reference Code Below /////////////////////
1311+
13431312
private static Dictionary<string, object> getJsonTransorm(Transform transform) {
13441313
return new Dictionary<string, object>() {
13451314
{"position", transform.position},
@@ -1394,9 +1363,7 @@ public static Dictionary<string, object> getCollider(Collider c) {
13941363
{"error", "Null collider"}
13951364
};
13961365
}
1397-
// else if (c.GetType() == typeof(MeshRenderer)) {
13981366

1399-
// }
14001367
return co;
14011368
}
14021369

@@ -1428,20 +1395,6 @@ public static void ExportProcthorPrimitiveColliders() {
14281395
else {
14291396
Debug.Log($"----- Error duplicate key {sop.assetID} object name: {sop.objectID}, GO name: {sop.gameObject.name}, index: {i}" );
14301397
}
1431-
// var jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(
1432-
// new Dictionary<string, object>() {
1433-
// {"colliders", colliders},
1434-
// {"assetId", sop.assetID}
1435-
// },
1436-
// Newtonsoft.Json.Formatting.None,
1437-
// new Newtonsoft.Json.JsonSerializerSettings() {
1438-
// ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
1439-
// ContractResolver = jsonResolver
1440-
// }
1441-
// );
1442-
1443-
// Debug.Log($"st {jsonStr}");
1444-
14451398
}
14461399

14471400
var jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(
@@ -1463,27 +1416,5 @@ public static void ExportProcthorPrimitiveColliders() {
14631416

14641417
file.Close();
14651418

1466-
// using(StreamWriter writetext = new StreamWriter("write.txt"))
1467-
// {
1468-
// writetext.writeLine
1469-
// writetext.WriteLine("writing in text file");
1470-
// }
1471-
1472-
// var colliderDict = m.ToDictionary(sop => (sop.assetID, new Dictionary<string, object>() {
1473-
// {"colliders", sop.MyColliders.Select(getCollider)},
1474-
// {"assetId", sop.assetID}
1475-
// }));
1476-
1477-
// var jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(
1478-
// colliderDict,
1479-
// Newtonsoft.Json.Formatting.None,
1480-
// new Newtonsoft.Json.JsonSerializerSettings() {
1481-
// ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
1482-
// ContractResolver = jsonResolver
1483-
// }
1484-
// );
1485-
1486-
// Debug.Log($"st {jsonStr}");
1487-
14881419
}
14891420
}

0 commit comments

Comments
 (0)