Copybara import of the project:

--
9d63ebca419496e36f94fbfec6f97f0227846cf5 by Balint-H <bkh16@ic.ac.uk>:

Throw exception if OBJ file is referenced in MJCF when loading in Unity

--
a50486c19a3483cd914e7957d7d4a5efaab9d977 by Balint-H <bkh16@ic.ac.uk>:

Adjust line length

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/2248 from Balint-H:fix/unity-obj-warning a50486c19a3483cd914e7957d7d4a5efaab9d977
PiperOrigin-RevId: 699962619
Change-Id: I2edff691fd5cedf79e2564f2ac5f2115393a4bf6
This commit is contained in:
Balint-H
2024-11-25 06:37:52 -08:00
committed by Copybara-Service
parent 38e4c4812f
commit e9a2f055f0
@@ -152,6 +152,13 @@ public class MjImporterWithAssets : MjcfImporter {
parentNode.GetStringAttribute("name", defaultValue: string.Empty);
var assetReferenceName = MjEngineTool.Sanitize(unsanitizedAssetReferenceName);
var sourceFilePath = Path.Combine(_sourceMeshesDir, fileName);
if (Path.GetExtension(sourceFilePath) == ".obj") {
throw new NotImplementedException("OBJ mesh file loading is not yet implemented. " +
"Please convert to binary STL. " +
$"Attempted to load: {sourceFilePath}");
}
var targetFilePath = Path.Combine(_targetMeshesDir, assetReferenceName + ".stl");
if (File.Exists(targetFilePath)) {
File.Delete(targetFilePath);