Skip to content

Commit

Permalink
Copybara import of the project:
Browse files Browse the repository at this point in the history
--
9d63ebc by Balint-H <[email protected]>:

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

--
a50486c by Balint-H <[email protected]>:

Adjust line length

COPYBARA_INTEGRATE_REVIEW=#2248 from Balint-H:fix/unity-obj-warning a50486c
PiperOrigin-RevId: 699962619
Change-Id: I2edff691fd5cedf79e2564f2ac5f2115393a4bf6
  • Loading branch information
Balint-H authored and copybara-github committed Nov 25, 2024
1 parent 38e4c48 commit e9a2f05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions unity/Editor/Importer/MjImporterWithAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ private void ParseMesh(XmlElement parentNode) {
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);
Expand Down

0 comments on commit e9a2f05

Please sign in to comment.