Skip to content

Commit

Permalink
Fixed:
Browse files Browse the repository at this point in the history
* STL meshes we rotated by 180°
  • Loading branch information
Kapim committed Dec 8, 2021
1 parent 2821544 commit 2e8f71b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arcor2_AREditor/Assets/BASE/Scripts/MeshImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ private void ImportMesh(string path, string aoId) {
// Supports: FBX, OBJ, GLTF2, STL, PLY, 3MF
AssetLoaderOptions assetLoaderOptions = AssetLoader.CreateDefaultLoaderOptions();
AssetLoader.LoadModelFromFile(path, null, delegate (AssetLoaderContext assetLoaderContext) {
if (Path.GetExtension(path).ToLower() == ".stl") {
assetLoaderContext.RootGameObject.transform.Rotate(0f, 180f, 0f);
}

OnMeshImported?.Invoke(this, new ImportedMeshEventArgs(assetLoaderContext.WrapperGameObject, aoId));
}, null, assetLoaderOptions: assetLoaderOptions, onError: OnModelLoadError, wrapperGameObject: loadedObject);
}
Expand Down

0 comments on commit 2e8f71b

Please sign in to comment.